So far, I've tried to run this on a fresh Mojave, and my main Catalina installation with the same hanging results. The code snippet to open FileDialog runs fine independently in a separate project, but if I create another class in the same package and call it like that, it's the same deal - still hanging. It's being called within the controller if that makes a difference (I've tried JFileChooser which also hangs, and seems to have a history of hanging on OS X. To reiterate I also tried extracting the code to open the dialog to a different class aswell.) It hangs when it reaches fd.setVisible(true);
. I've tried disabling iCloud as I've heard that can cause issues, I've also disabled SIPS as a test. I'm not even sure how I can debug this further now. Any help would be super appreciated!
JFrame frame = new JFrame();
System.setProperty("apple.awt.fileDialogForDirectories", "true");
FileDialog fd = new FileDialog(frame, "Choose a file", FileDialog.LOAD);
fd.setVisible(true);
String filename = fd.getFile();
System.out.println(filename);