Core Java| JSP| Servlets| XML| EJB| JEE5| Web Services| J2ME| Glossary| Questions?

 

 

 

 

 

 

 

 

 

 

 

 

 

Search Tutorials

Latest Questions
Comments
 
Tree Root Hide in Java 
 

In this section, you will learn to hide the root node of a JTree.

 

Tree Root Hide in Java

                         

In this section, you will learn to hide the root node of  a JTree

Description of the Program:

The following program helps to hide the root node of the Jtree component. This program creates a tree that contains multiple nodes where the root node is kept hidden. The getProperty() method determines the current system properties. This method returns the multiple data of system that will be displayed in a node. For hiding root node we set the setRootVisible is 'false'. 

Here is the code of this program:

import javax.swing.*;
import javax.swing.event.*;
import java.util.Properties;
import javax.swing.JTree.*;

public class TreeRootHide{
  public static void main(String[] args) {
    JFrame frame = new JFrame("Root Hide of tree");
    Properties prop = System.getProperties();
    JTree tree = new JTree(prop);
    tree.setRootVisible(false);
    JScrollPane scroll = new JScrollPane(tree);
    frame.getContentPane().add(scroll, "Center");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE)
    frame.setSize(350,400);
    frame.setVisible(true);
  }
}

Download this program.

Output this program:

 

                         

» View all related tutorials
Related Tags: c ide class methods method get icon height vi width change using int id ai create js define show paint

Leave your comment:

Name:

Email:

URL:

Title:

Comments:


Enter Code:

Audio Version
Reload Image
 

Note: Emails will not be visible or used in any way, and are not required. Please keep comments relevant. Any content deemed inappropriate or offensive may be edited and/or deleted.

No HTML code is allowed. Line breaks will be converted automatically. URLs will be auto-linked. Please use BBCode to format your text.

Add This Tutorial To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Training Courses
Tell A Friend
Your Friend Name
Software Solutions
Least Viewed
Most Rated
Recently Viewed
Search Tutorials

 

 
 

Home | JSP | EJB | JDBC | Java Servlets | WAP  | Free JSP Hosting  | Search Engine | News Archive | Jboss 3.0 tutorial | Free Linux CD's | Forum | Blogs

About Us | Advertising On RoseIndia.net  | Site Map

India News

Indian Software Development Company | iPhone Development Company in India | Flex Development Company in India | Java Training Delhi | Java Training at Noida |

Send your comments, Suggestions or Queries regarding this site at roseindia_net@yahoo.com.

Copyright © 2008. All rights reserved.