File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Swing / AWT / SWT and the fly likes JFileChooser lookandfeel Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Badass: Making Users Awesome this week in the Game Development forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JFileChooser lookandfeel" Watch "JFileChooser lookandfeel" New topic

JFileChooser lookandfeel

Matti Poro
Ranch Hand

Joined: Dec 03, 2005
Posts: 41
I have a program that uses MetalLookAndFeel but JFileChooser doesn't look so nice with that lookandfeel. I wonder if it is possible to make JFileChooser have the native lookandfeel.
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42954
You could use an AWT FileDialog instead. That should be closer to the native LAF.
Matti Poro
Ranch Hand

Joined: Dec 03, 2005
Posts: 41
Thank you. It looks perfect.
Casper Maxwell
Ranch Hand

Joined: Aug 04, 2005
Posts: 88
In my experience if you do not apply look-and-feel separately to JFileChooser, you see initial LF. So i think you can apply a different LF to your JFileChooser. An example code is in the url below if you need (you need to call SwingUtilities.updateComponentTreeUI(..) only on JFileChooser):

How to change the look and feel of Swing applications
I agree. Here's the link:
subject: JFileChooser lookandfeel