views:

392

answers:

3

I succeeded in creating a JFileChooser in the windows look and feel with the following code

try {
        UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
    } catch (Exception e) {     }

But when the JFileChooser comes up, it is missing buttons to the right of the drop-down menu of file names. The buttons that are missing are the up one level, create new Folder, list view, and details view buttons.

Any ideas on how I can get them back?

Thanks!

A: 

Are you sure there are no exceptions spitted out ? Perhaps put a e.printStackTrace() in the catch block just to be 100% sure that there are no exceptions

Calm Storm
nope - no exceptions.
chama
+1  A: 

JFileChooser isn't a native dialog. In fact, nothing in Swing is.

If you want native controls and dialogs, you need to use SWT instead of Swing.

R. Bemrose
A: 

It seems to be a particular problem with my computer - when I run this program on other computers, the buttons appear. Go figure.

chama
make sure you are using exactly the same version of the java runtime environment on both PCs
clamp