*
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 Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JFileChooser lookandfeel" Watch "JFileChooser lookandfeel" New topic
Author

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
Marshal

Joined: Mar 22, 2005
Posts: 41051
    
  43
You could use an AWT FileDialog instead. That should be closer to the native LAF.


Ping & DNS - my free Android networking tools app
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
http://www.java-tips.org/content/view/762/2/
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: JFileChooser lookandfeel
 
Similar Threads
About LookAndFeel
LookAndFeel updating and JToolBar
UIManager
JFileChooser opendialog question
Change LookAndFeel in individual Swing components