This week's book giveaway is in the Big Data forum.
We're giving away four copies of Elasticsearch in Action and have Radu Gheorghe & Matthew Lee Hinman on-line!
See this thread for details.
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 Elasticsearch in Action this week in the Big Data 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
Don't get me started about those stupid light bulbs.
subject: JFileChooser lookandfeel