Set component look and feel
I'm using substance look and feel as my application default look and feel, however I want to set the system look and feel for FileDialog especially in Mac OS. Is it possible to set FileDialog 开发者_运维技巧to use look and feel other than the application look and feel?
Thanks
java.awt.FileDialog
is not a Swing component, so it doesn't have a UI delegate to change. Although some prefer the former on Mac OS X, consider javax.swing.JFileChooser
as an alternative.
The LAF of a component is determined when a component is created. So you can try using:
a) set the LAF b) create and instance of the component c) restore the LAF to your default LAF
Some people have recommended against this approach suggesting that all components should be of the same LAF and there may be some unexpected problems when you try to mix LAF's. I'll let you be the judge if this will work for you or not.
精彩评论