How to use the default File Chooser for the operating system? java

mattbdean picture mattbdean · May 24, 2012 · Viewed 16.9k times · Source

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?

Answer

Mattias Isegran Bergander picture Mattias Isegran Bergander · May 24, 2012

Use the old java.awt.FileDialog instead:

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