Search code examples
javajfilechooser

How to use the default file chooser for the operating system?


I was just wondering: how does Gmail use the Windows/Mac file chooser to upload files? Is there any way to do this in Java?

enter image description here

Personally, I don't like the way that the JFileChooser looks like, and I thought it would be better for my users to be able to use something that they're more used to. Tips anyone?


Solution

  • Use the old java.awt.FileDialog instead:

    new java.awt.FileDialog((java.awt.Frame) null).setVisible(true);