The JTree class is used to display the tree structured data or hierarchical data. JTree is a complex component. It has a 'root node' at the top most which is a parent for all nodes in the tree. It inherits JComponent class.
Let's see the declaration for javax.swing.JTree class.
public class JTree extends JComponent implements Scrollable, Accessible
|JTree()||Creates a JTree with a sample model.|
|JTree(Object value)||Creates a JTree with every element of the specified array as the child of a new root node.|
|JTree(TreeNode root)||Creates a JTree with the specified TreeNode as its root, which displays the root node.|
A11 Acharya Niketan
Mayur Vihar 1
Near MayurVihar Metro Station