How to select multiple folders and files in Javafx2?
We can use the JFileChooer of the Swing component. But then it gives an error like something like Headless. So remove this error by following the steps below.
1) Initialized all swing component before javafx. 2) use System.setProperty and set Headless to false.
Then jfilechooser works. Thanks everyone.
source to share
JavaFX supports one or more file dialogs:
http://docs.oracle.com/javafx/2/api/javafx/stage/FileChooser.html
and a single directory dialog:
http://docs.oracle.com/javafx/2/api/javafx/stage/DirectoryChooser.html
There was a special RFE for this: https://bugs.openjdk.java.net/browse/JDK-8101526 .
There is a special RFE for multiple chosign directories, you can wait until it is fixed: https://bugs.openjdk.java.net/browse/JDK-8091403 , also you can vote for it to be fixed with a higher priority
source to share