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.
Here is the code of this program:
Output this program: