Apparently, there are (at least?) two different native File choosers on Windows (10). There is this one, which is used by JFileChooser
and other programs:
And there is that one, for example used by Chrome:
I like it much more than the first one because:
How do I get it in Java?
FileChooser fileChooser = new FileChooser();
fileChoose.showOpenDialog(null);
To run it in a swing context, have a look at those two answers.
PlatformImpl.startup(() -> {
FileChooserd = new FileChooser();
d.showOpenDialog(null);
});
new JFXPanel();
Platform.runLater(() -> {
FileChooser d = new FileChooser();
d.showOpenDialog(null);
});
Note that other things like modality won't work when mixing JavaFX and Swing. Also, you will have to build some code that waits until the Runnable has finished to be able to fetch the results.
native file dialogs provides native file dialogs, and LWJGL 3 provides Java bindings for this library.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With