Does somebody knows how to detect if user selected cancel button or root disk in java.awt.FileDialog in Mac OS (10.6 - Snow Leopard)????
I have the below code:
System.setProperty("apple.awt.fileDialogForDirectories", "true");
FileDialog fd = new FileDialog(this);
fd.setDirectory(_projectsBaseDir.getPath());
fd.setLocation(50,50); fd.setVisible(true);
File selectedFile = new File(fd.getFile());
System.setProperty("apple.awt.fileDialogForDirectories", "false");
But if user selects primary disk on the left panel (below Devices), the selection returns null, I cannot diferentiate if user selected primary disk or presssed the cancel button. (both actions return null).