Re: how to change look&feel
Marek Slama <[email protected]>
| Newsgroups | gmane.comp.java.netbeans.user-interface |
|---|---|
| Message-ID | <[email protected]> |
Richard Bair wrote:
> try {
> UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
> } catch (Exception e) {}
>
>
> On Nov 10, 2006, at 6:10 AM, johnrajbd wrote:
>
>>
>> try {
>>
>> UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
>>
>> } catch (Exception e) { }
>>
>> i used these code in the constructor after initComponents(); function in
>> Netbeans. but it's not working.
You should set L&F *BEFORE* any Swing component is initialized. You
should also check what L&Fs are supported
on your platform (UIManager gives list of available L&Fs). Actualy
changing L&F at runtime is possible (see SwingSet2 in JDK
demos) but it might need some testing/fixing if you use advanced Swing
code. So if you want to support runtime change of L&F
in your apps you should test it.
You can also set L&F using property -Dswing.defaultlaf=<L&F class name>
Marek
>>
>> --View this message in context:
>> http://www.nabble.com/how-to-change-look-feel-tf2605460.html#a7277560
>> Sent from the Netbeans - UI mailing list archive at Nabble.com.