JTree displays the System files in a tree format, JTable displays the list of files in the selected path.
Project Demo: File Explorer
Displaying System files
Right clicking on the JTree and JTable opens the Popup Menu of Options to manipulate files
Capture_FileExplorer_TablePopup
Capture_FileExplorer_TreePopup
Selecting the Rename Options, pops a JOptionPane to input the new file name
Capture_FileExplorer_RenameButton
Selecting the Delete Option, pops a JOptionPane to confirm if the user wants to delete the file
Capture_FileExplorer_DeleteButton
Selecting the Open option, opens a new JDialog which displays the contents of the file, which can be edited
Capture_FileExplorer_OpenButton
Contents of the edited file can be saved by clicking on Edit -> Save
Capture_FileExplorer_SaveOption
Selecting a file or directory in the JTree and Clicking the Refresh Button, Refreshes the JTree to point on that particular path
Capture_FileExplorer_RefreshButton
To go back to the Home Directory, click on the below Home Button
Capture_FileExplorer_HomeButton
- some unexpected file names throw a runtime error, but they can be ignored as it doesn't affect the working of the application.
- After updating files, the explorer may not refresh automatically, refresh and home buttons will refresh the explorer to the current updated state.