How to run jFileChooser in console-application? Is it possible?
-
17-06-2021 - |
Pregunta
I tried to do this with this piece of code:
JFileChooser chooser = new JFileChooser();
int retval = JFileChooser.CANCEL_OPTION;
chooser.setFileSelectionMode( JFileChooser.DIRECTORIES_ONLY);
retval = chooser.showDialog(null, "Select");
But it didn't work. Console just waited for input...
Solución
You need to run it as java -jar exported.jar
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow