I need to know which of the 3 is best for me. My requirements are as follows in order of importance:
- Save and load files with ease.
- File type filter during file selection (not afterwards).
- Look and feel is exactly the same as the native OS L&F.
If there is a dialog that I've not mentioned that would be more ideal, please let me know.
What is the rest of your application written in? If you used AWT you should use
FileDialog
. If you used Swing you should useJFileChooser
. Both classes meet all of your requirements. (AJDialog
is simply an empty window, you can only use it to open files if you add aComponent
to it which allows you to, andJFileChooser
already does this for you.)Saving and loading has to be written with your own methods, both
JFileChooser
andFileDialog
can only be used to select file(s).Both
FileDialog
andJFileChooser
support file filters during selection.FileDialog
's default UI is the native OS'.JFileChooser
's (in fact, your entire applicatin's) UI can be set to the native OS' withUIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName())
.