change look&feel for file chooser

hello,

i am using a 3rd party look&feel in my application.

it looks greate, but the file chooser looks different and not very nice.

i wanne have it look like the file chooser when WindowsLookAndFeel is set.

my question: can i set the windowslookandfeel only for jfilechooser?

thx

lukas

[332 byte] By [lukas.mysliveca] at [2007-10-3 4:31:16]
# 1
hi,u can set windows look and feel in the file chooser .but once u set this look and feel means complete look and feel will change.because of that whenever u close the file chooser u set again ur third party look and feel.regardspradeep
Pradeep_M_Va at 2007-7-14 22:34:40 > top of Java-index,Desktop,Core GUI APIs...
# 2

You don't need to do that. You can apply any UI to any component after the default has been implicitly installed during its construction.

eg,

JFileChooser f = new JFileChooser();

f.setUI(new BasicFileChooserUI());

You do have to be careful with other L&Fs, though. For instance the Windows L&F is only available on Windows platforms, so you'd have to do something like the following,

JFileChooser f = new JFileChooser();

FileChooserUI ui = null;

try

{

ui = Class.forName("com.sun.java.swing.plaf.windows.WindowsFileChooserUI").newInstance();

}

catch (Exception e)

{

ui = new BasicFileChooserUI();

}

f.setUI(new BasicFileChooserUI());

itchyscratchya at 2007-7-14 22:34:40 > top of Java-index,Desktop,Core GUI APIs...