A JFileChooser
used to select a directory is initialized using:
JFileChooser directoryChooser = new JFileChooser();
directoryChooser.setDialogTitle("Choose Directory");
directoryChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
directoryChooser.setAcceptAllFileFilterUsed(false);
and opened using:
directoryChooser.updateUI();
directoryChooser.showOpenDialog(null);
File selectedFile = directoryChooser.getSelectedFile();
which works and i can select a directory but i don't like it's appearance:
I would like it to have the same appearance as the DirectoryChooser
in JavaFx
, which is also the same appearance for example as the open/save dialog in Chrome & Firefox. That would also make it possible to enter the path manually.
Is it possible to achieve what i want without using JavaFx and if so how can i change it's appearance?