Skip to content

File

Drop a file from a Java application

DragSource

You can drop files from a Java application onto the Windows desktop, etc.

File drag and drop

FileListFlavor

Drag and drop files from Windows or other operating systems into the JTable.

Recursive search of files

RecursiveFileSearch

This program recursively searches for files within the specified directory and displays the progress using a JProgressBar.

Checking the Device Name

DeviceName

This tool checks if the string entered in the file chooser or similar tool is a valid file name that does not contain device file names such as con, prn, nul, or aux.

Create a numbered backup file.

BackupFile

This will create backup files with numbered extensions.

Get the SystemIcon for File

SystemIcon

Retrieves System Icons for files, directories, etc.

Sort files and directories separately in JTable

Section titled “Sort files and directories separately in JTable”
Sort files and directories separately in JTable

FileDirectoryComparator

Use JTable to group files and directories, sort them separately, and configure it so that the directory group is always at the top.

Displaying the directory structure in JTree using FileSystemView

Section titled “Displaying the directory structure in JTree using FileSystemView”
Displaying the directory structure in JTree using FileSystemView

DirectoryTree

We will use FileSystemView to display the directory structure on JTree.

Display a file overwrite warning dialog while JFileChooser is open.

Section titled “Display a file overwrite warning dialog while JFileChooser is open.”
Display a file overwrite warning dialog while JFileChooser is open.

FileAlreadyExistsDialog

When saving with JFileChooser, if you select an existing file and press the save button, a warning dialog box will be displayed to overwrite the file.

Save and restore JTable models as XML files.

Section titled “Save and restore JTable models as XML files.”
Save and restore JTable models as XML files.

PersistenceDelegate

JTable models are saved and restored as XML files using XMLEncoder and XMLDecoder.

Extract the zip file selected with JFileChooser.

Section titled “Extract the zip file selected with JFileChooser.”
Extract the zip file selected with JFileChooser.

ZipFile

This function extracts the zip file selected with JFileChooser, or compresses the directory into a zip file.

Convert the image to a string using a Base64 encoder.

Section titled “Convert the image to a string using a Base64 encoder.”
Convert the image to a string using a Base64 encoder.

Base64Encoder

The Base64 encoder converts the image file to a string, and the decoder converts the string to an ImageIcon.

Display file additions, deletions, etc., to a specified directory in a JTable.

Section titled “Display file additions, deletions, etc., to a specified directory in a JTable.”
Display file additions, deletions, etc., to a specified directory in a JTable.

WatchingDirectoryTable

Use WatchService to monitor directory changes and display file additions and deletions in a JTable.

Select a file in FileDialog

FileDialog

Select a file using the File dialog.

Section titled “Navigate to the Windows LNK shortcut location using the folder structure displayed in JTree.”
Navigate to the Windows LNK shortcut location using the folder structure displayed in JTree.

ResolveShortcutsLinkLocation

If the TreeNode in a folder structure created using JTree is a Windows lnk shortcut, you can use JFileChooser's ShellFolder to make it possible to navigate to the linked folder.