views:

492

answers:

3

I have an installer program that lets the user choose a directory in which to install. The JFileChooser implementation on MacOS uses a native dialog (or at least it looks native). That's great.

The only problem is there's no way to create a directory from this dialog ... you can only choose a pre-existing one, which is clunky. Is there a way to get this functionality?

I use the JFileChooser in "select directories only" mode. Thus it isn't the same dialog as the usual MacOS file picker which does have that functionality.

+2  A: 

That is correct that the showOpenDialog method will not give you an option to create new folders. This is a usability thing as it does not really make sense to open something that does not exist. If you use the showSaveDialog there will be a button 'Make new Folder' or similar to that.

willcodejavaforfood
A: 

It's a Mac, you're not supposed to give the user choices - learn where the correct place for your files is and put them there.

Tom
A: 
public static void main(String[] args) throws UnsupportedLookAndFeelException {
    JFrame frame = new JFrame();
    FileDialog d = new FileDialog(frame);
    d.setVisible(true);
}
Steve McLeod