In my swing application I want my application to open the my specific directory say "c:\mydirectory" when browse button is clicked.
How to select default FileFilter when creating a JFileChooser dialog?
Following code can be used:
JFileChooser c = new JFileChooser(); c.setFileSelectionMode(c.DIRECTORIES_ONLY); String defaultDirectoryPath = "C:\\mydirectory"; c.setSelectedFile(new File(defaultDirectoryPath));
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.