Skip to content

Instantly share code, notes, and snippets.

@ahmedhosnypro
Created June 14, 2022 02:13
Show Gist options
  • Save ahmedhosnypro/132fdb1a38dd9b4c249b4e54f047ede6 to your computer and use it in GitHub Desktop.
Save ahmedhosnypro/132fdb1a38dd9b4c249b4e54f047ede6 to your computer and use it in GitHub Desktop.
// https://mvnrepository.com/artifact/li.flor/NativeJFileChooser
// implementation group: 'li.flor', name: 'NativeJFileChooser', version: '1.6.3'
JFileChooser fileChooser = new NativeJFileChooser("D:\\SafwahResult_bot\\resources");
// fileChooser.setFileFilter(new FileNameExtensionFilter("images", "*.jpg")); // select files
fileChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); // select Dir
fileChooser.showSaveDialog(null);
System.out.println(fileChooser.getCurrentDirectory());
System.out.println(fileChooser.getSelectedFile());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment