Home | Ajax | BioInformatics | Dojo | EAI | EJB | Hibernate | J2ME | Java | Java Glossary | Java Servlets | JavaScript | Jboss | JDBC | JDO | Jmeter | JSF | JSP | JUnit | Maven | MySQL | Spring Framework | SQL | Struts | Technology | WAP | Web Services | XML


 
  
 
Programming Tutorials: Ajax | Articles | JSP | Bioinformatics | Database | Free Books | Hibernate | J2EE | J2ME | Java | JavaScript | JDBC | JMS | Linux | MS Technology | PHP | RMI | Web-Services | Servlets | Struts | UML
 

 
Facing Programming Problem?
Ask Questions?, Browse Latest Questions, Question-Answer Guidelines
Java
  JDO Tutorials
  EAI Articles
  Struts Tutorials
  Java Tutorials
  Java Certification
  Java Applet
Questions
Comments

Displaying System Files in JTree

                         

In this section, you will learn to create a JTree that displays system files. The java.util.properties package represents a persistent set of properties for displaying the system files in a tree.

Description of the program:

This program teaches to display all system files in a tree on the frame. First of all you need a frame that displays the system files in  a tree. The getProperties() displays the current values of system and returns the  system objects. Create a tree using JTree() constructor with system property. The setLookAndFeel() method sets look and feel of the generated tree. This method takes a string argument ("com.sun.java.swing.plaf.windows.WindowsLookAndFeel") that displays the formatting design of the tree. If you want to display the root node, you must be use setRootVisibles(true) method.

getProperties(): 
This method displays the current values of system and searchs the property with the specified key in the properties list.

Here is the code of this program:

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

public class FileDirectoryTree{
  public static void main(String[] args) {
    try {
      UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
      JFrame fm = new JFrame("System file properties of tree ");
      Properties p = System.getProperties();
      JTree tree = new JTree(p);
      tree.setRootVisible(true);
      JScrollPane scrollpane = new JScrollPane(tree);
      fm.getContentPane().add(scrollpane, "Center");
      fm.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE)
      fm.setSize(450,400);
      fm.setVisible(true);
    }
    catch (Exception e) {}
  }
}

Download this program. 

Output this program:

                         

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 
Latest Searches:
tomcate 5.0 downloadab
videofile
url redirecting in ser
commands
flex
emailing file in java
standered jstl jar to
ะ�ะ�ะ�ะ?
Photoshop Textures and
arraylist of arraylist
append mesage
hibernate3.0 jar file
creating batch in sql
login session servlet
Date Examples java
Java Tuthreadstorials
JSF Data tree
sum of n integers
Photoshop Textures and
insert query
Combattons la programm
ejb entity bean
PhotoshopTech/Abstract
Servlet Container
jstl list size
word
websphere portals
ASP.NET .NET Introduct
update mysql jsp
weblogic 10.3
Aå??ç?­??å??ç?­??å??ç?
fjhjf
jdbc connection
AOP
edit cell JTable
how to reload page aft
dynamic insert value J
ado
Hibernate API
Photoshop Textures and
passing value from ser
sequence number genera
jira Testing tool free
Murachâ?¨??â?¨??â?¨??â
org.apache.poi.hssf.us
toolsfordesigningacomp
program for display th
Class Variables and Me
Linux Caixa MÑ?â??г?Ñ
SUBMITTING MULTIPLE FO
Reports
all ejb program
examples of sql
ASP Graphs and Charts
java jtable
remember
java applets
ASP.NET .NET File Uplo
html:img
fetch the datas from M
???а?????а????а????
jsp mysql combo box
JButton with image
Wireless
median
mysql to JTable
emailing file using js
how to read the data i
PL/]SQL
jsf custom components
create commandin mysql
learn core java
shopping
create a class callled
two dimensional array
sort object compareTo
Jsf Tomahawk
desicont
Listeners
jfreechart
Java String toLowerCase Example
Java String toCharArray Example
Java String substring Example
Java String indexOf Example
Java String startsWith Example
Java String hashCode Example
Java String matches Example
Java String length Example
Java String lastIndexOf Example
Java String isEmpty Example
Java String equalsIgnoreCase Example
Java String equals Example
Java String endsWith Example
Java String copyValueOf Example
Java String contentEquals Example
  EAI Articles
  Java Certification
Tell A Friend
Your Friend Name
Search Tutorials

 

 
 
Browse all Java Tutorials
Java JSP Struts Servlets Hibernate XML
Ajax JDBC EJB MySQL JavaScript JSF
Maven2 Tutorial JEE5 Tutorial Java Threading Tutorial Photoshop Tutorials Linux Technology
Technology Revolutions Eclipse Spring Tutorial Bioinformatics Tutorials Tools SQL
 

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 | 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.