P
Praetorian
Hi,
I want to modify the look and feel of a JTree (running on Windows) to
the cross platform L&F and am using the following code in my JTree
subclass constructor.
try {
UIManager.setLookAndFeel
( UIManager.getCrossPlatformLookAndFeelClassName() );
SwingUtilities.updateComponentTreeUI( this );
} catch ( Exception e ) {
System.err.println( "L&F exception: " + e.toString() );
}
The problem with this code is that it modifies the global L&F instead
of just that of this JTree instance. I'm loading this JTree into a
MATLAB GUI and since the MATLAB desktop is written in java as soon as
I load this tree the MATLAB desktop colors change too. How can I
change the L&F of the just the JTree instance (all JTrees would be ok
too if I can restore it to the original when this instance is closed).
Thanks in advance,
Ashish.
I want to modify the look and feel of a JTree (running on Windows) to
the cross platform L&F and am using the following code in my JTree
subclass constructor.
try {
UIManager.setLookAndFeel
( UIManager.getCrossPlatformLookAndFeelClassName() );
SwingUtilities.updateComponentTreeUI( this );
} catch ( Exception e ) {
System.err.println( "L&F exception: " + e.toString() );
}
The problem with this code is that it modifies the global L&F instead
of just that of this JTree instance. I'm loading this JTree into a
MATLAB GUI and since the MATLAB desktop is written in java as soon as
I load this tree the MATLAB desktop colors change too. How can I
change the L&F of the just the JTree instance (all JTrees would be ok
too if I can restore it to the original when this instance is closed).
Thanks in advance,
Ashish.