aspose file tools*
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
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
 
 
subject: JTree