This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes JTree Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JTree" Watch "JTree" New topic
Author

JTree

Pink Stac
Greenhorn

Joined: Nov 01, 2001
Posts: 2
Im using JTree .The default symbol of the closed and open icon is a circle with a dot in it.I want the explorer look.ie a plus and minus sign.If i use an icon it attatches it after the already existing symbol...
Kindly suggest how can i do it
Manfred Leonhardt
Ranch Hand

Joined: Jan 09, 2001
Posts: 1492
Hi Pink,
Look at the javax.swing.UIManager. To get the WindowsLookAndFeel you just use the following before you create your tree:
try
{
UIManager.setLookAndFeel( "com.sun.java.swing.plaf.windows.WindowsLookAndFeel" );
}
catch( Exception e ) {};
This will change all components created to WindowsLookAndFeel if you don't want that then you need to perform the exact thing again after your tree is created to get back to whatever look and feel you want. For example:
try
{
UIManager.setLookAndFeel( UIManager.getCrossPlatformLookAndFeelClassName() );
}
catch( Exception e ) {};
could be used to get back to the Metal LookAndFeel.
Regards,
Manfred.
Pink Stac
Greenhorn

Joined: Nov 01, 2001
Posts: 2
Thanks a lot
 
Don't get me started about those stupid light bulbs.
 
subject: JTree
 
Similar Threads
JTree
Jtree help
ImageIcon in JTREE
JTree
JTree leaf