I had a problem with JFileChooser for a long time and could not find help ... The problem is that the file window does not appear. I tried to find the cause of this problem, and I tested the following:
public class Test {
public static void main (String[] args) {
load();
}
public static void load () {
String folder = System.getProperty("user.dir");
JFileChooser fc = new JFileChooser(folder);
int resultat = fc.showOpenDialog(null);
}
}
When I run this code, I get a window to display.
But when I try this:
public class Test {
public static void main (String[] args) {
String input = JOptionPane.showInputDialog(null, "Make your choice!\n" +
"1. load file");
load();
}
}
the window is not yet displayed, the programming is still running ... I do not know what might cause this problem.
source
share