javax.swing
Class JTree

java.lang.Object sample code for java.lang.Object definition code for java.lang.Object 
  extended by java.awt.Component sample code for java.awt.Component definition code for java.awt.Component 
      extended by java.awt.Container sample code for java.awt.Container definition code for java.awt.Container 
          extended by javax.swing.JComponent sample code for javax.swing.JComponent definition code for javax.swing.JComponent 
              extended by javax.swing.JTree
All Implemented Interfaces:
ImageObserver sample code for java.awt.image.ImageObserver definition code for java.awt.image.ImageObserver , MenuContainer sample code for java.awt.MenuContainer definition code for java.awt.MenuContainer , Serializable sample code for java.io.Serializable definition code for java.io.Serializable , Accessible sample code for javax.accessibility.Accessible definition code for javax.accessibility.Accessible , Scrollable sample code for javax.swing.Scrollable definition code for javax.swing.Scrollable

public class JTree
extends JComponent sample code for javax.swing.JComponent definition code for javax.swing.JComponent
implements Scrollable sample code for javax.swing.Scrollable definition code for javax.swing.Scrollable , Accessible sample code for javax.accessibility.Accessible definition code for javax.accessibility.Accessible

A control that displays a set of hierarchical data as an outline. You can find task-oriented documentation and examples of using trees in How to Use Trees, a section in The Java Tutorial.

A specific node in a tree can be identified either by a TreePath (an object that encapsulates a node and all of its ancestors), or by its display row, where each row in the display area displays one node. An expanded node is a non-leaf node (as identified by TreeModel.isLeaf(node) returning false) that will displays its children when all its ancestors are expanded. A collapsed node is one which hides them. A hidden node is one which is under a collapsed ancestor. All of a viewable nodes parents are expanded, but may or may not be displayed. A displayed node is both viewable and in the display area, where it can be seen.

The following JTree methods use "visible" to mean "displayed":

The next group of JTree methods use "visible" to mean "viewable" (under an expanded parent):

If you are interested in knowing when the selection changes implement the TreeSelectionListener interface and add the instance using the method addTreeSelectionListener. valueChanged will be invoked when the selection changes, that is if the user clicks twice on the same node valueChanged will only be invoked once.

If you are interested in detecting either double-click events or when a user clicks on a node, regardless of whether or not it was selected, we recommend you do the following:

 final JTree tree = ...;

 MouseListener ml = new MouseAdapter() {
     public void mousePressed(MouseEvent e) {
         int selRow = tree.getRowForLocation(e.getX(), e.getY());
         TreePath selPath = tree.getPathForLocation(e.getX(), e.getY());
         if(selRow != -1) {
             if(e.getClickCount() == 1) {
                 mySingleClick(selRow, selPath);
             }
             else if(e.getClickCount() == 2) {
                 myDoubleClick(selRow, selPath);
             }
         }
     }
 };
 tree.addMouseListener(ml);
 
NOTE: This example obtains both the path and row, but you only need to get the one you're interested in.

To use JTree to display compound nodes (for example, nodes containing both a graphic icon and text), subclass TreeCellRenderer sample code for javax.swing.tree.TreeCellRenderer definition code for javax.swing.tree.TreeCellRenderer and use setCellRenderer(javax.swing.tree.TreeCellRenderer) sample code for javax.swing.JTree.setCellRenderer(javax.swing.tree.TreeCellRenderer) definition code for javax.swing.JTree.setCellRenderer(javax.swing.tree.TreeCellRenderer) to tell the tree to use it. To edit such nodes, subclass TreeCellEditor sample code for javax.swing.tree.TreeCellEditor definition code for javax.swing.tree.TreeCellEditor and use setCellEditor(javax.swing.tree.TreeCellEditor) sample code for javax.swing.JTree.setCellEditor(javax.swing.tree.TreeCellEditor) definition code for javax.swing.JTree.setCellEditor(javax.swing.tree.TreeCellEditor) .

Like all JComponent classes, you can use InputMap sample code for javax.swing.InputMap definition code for javax.swing.InputMap and ActionMap sample code for javax.swing.ActionMap definition code for javax.swing.ActionMap to associate an Action sample code for javax.swing.Action definition code for javax.swing.Action object with a KeyStroke sample code for javax.swing.KeyStroke definition code for javax.swing.KeyStroke and execute the action under specified conditions.

Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. As of 1.4, support for long term storage of all JavaBeansTM has been added to the java.beans package. Please see XMLEncoder sample code for java.beans.XMLEncoder definition code for java.beans.XMLEncoder .

See Also:
Serialized Form

Nested Class Summary
protected  class JTree.AccessibleJTree sample code for javax.swing.JTree.AccessibleJTree definition code for javax.swing.JTree.AccessibleJTree
          This class implements accessibility support for the JTree class.
static class JTree.DynamicUtilTreeNode sample code for javax.swing.JTree.DynamicUtilTreeNode definition code for javax.swing.JTree.DynamicUtilTreeNode
          DynamicUtilTreeNode can wrap vectors/hashtables/arrays/strings and create the appropriate children tree nodes as necessary.
protected static class JTree.EmptySelectionModel sample code for javax.swing.JTree.EmptySelectionModel definition code for javax.swing.JTree.EmptySelectionModel
          EmptySelectionModel is a TreeSelectionModel that does not allow anything to be selected.
protected  class JTree.TreeModelHandler sample code for javax.swing.JTree.TreeModelHandler definition code for javax.swing.JTree.TreeModelHandler
          Listens to the model and updates the expandedState accordingly when nodes are removed, or changed.
protected  class JTree.TreeSelectionRedirector sample code for javax.swing.JTree.TreeSelectionRedirector definition code for javax.swing.JTree.TreeSelectionRedirector
          Handles creating a new TreeSelectionEvent with the JTree as the source and passing it off to all the listeners.
 
Nested classes/interfaces inherited from class javax.swing.JComponent sample code for javax.swing.JComponent definition code for javax.swing.JComponent
JComponent.AccessibleJComponent sample code for javax.swing.JComponent.AccessibleJComponent definition code for javax.swing.JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container sample code for java.awt.Container definition code for java.awt.Container
Container.AccessibleAWTContainer sample code for java.awt.Container.AccessibleAWTContainer definition code for java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component sample code for java.awt.Component definition code for java.awt.Component
Component.AccessibleAWTComponent sample code for java.awt.Component.AccessibleAWTComponent definition code for java.awt.Component.AccessibleAWTComponent , Component.BltBufferStrategy sample code for java.awt.Component.BltBufferStrategy definition code for java.awt.Component.BltBufferStrategy , Component.FlipBufferStrategy sample code for java.awt.Component.FlipBufferStrategy definition code for java.awt.Component.FlipBufferStrategy
 
Field Summary
static String sample code for java.lang.String definition code for java.lang.String ANCHOR_SELECTION_PATH_PROPERTY sample code for javax.swing.JTree.ANCHOR_SELECTION_PATH_PROPERTY definition code for javax.swing.JTree.ANCHOR_SELECTION_PATH_PROPERTY
          Bound property name for anchor selection path.
static String sample code for java.lang.String definition code for java.lang.String CELL_EDITOR_PROPERTY sample code for javax.swing.JTree.CELL_EDITOR_PROPERTY definition code for javax.swing.JTree.CELL_EDITOR_PROPERTY
          Bound property name for cellEditor.
static String sample code for java.lang.String definition code for java.lang.String CELL_RENDERER_PROPERTY sample code for javax.swing.JTree.CELL_RENDERER_PROPERTY definition code for javax.swing.JTree.CELL_RENDERER_PROPERTY
          Bound property name for cellRenderer.
protected  TreeCellEditor sample code for javax.swing.tree.TreeCellEditor definition code for javax.swing.tree.TreeCellEditor cellEditor sample code for javax.swing.JTree.cellEditor definition code for javax.swing.JTree.cellEditor
          Editor for the entries.
protected  TreeCellRenderer sample code for javax.swing.tree.TreeCellRenderer definition code for javax.swing.tree.TreeCellRenderer cellRenderer sample code for javax.swing.JTree.cellRenderer definition code for javax.swing.JTree.cellRenderer
          The cell used to draw nodes.
protected  boolean editable sample code for javax.swing.JTree.editable definition code for javax.swing.JTree.editable
          Is the tree editable? Default is false.
static String sample code for java.lang.String definition code for java.lang.String EDITABLE_PROPERTY sample code for javax.swing.JTree.EDITABLE_PROPERTY definition code for javax.swing.JTree.EDITABLE_PROPERTY
          Bound property name for editable.
static String sample code for java.lang.String definition code for java.lang.String EXPANDS_SELECTED_PATHS_PROPERTY sample code for javax.swing.JTree.EXPANDS_SELECTED_PATHS_PROPERTY definition code for javax.swing.JTree.EXPANDS_SELECTED_PATHS_PROPERTY
          Bound property name for expands selected paths property
static String sample code for java.lang.String definition code for java.lang.String INVOKES_STOP_CELL_EDITING_PROPERTY sample code for javax.swing.JTree.INVOKES_STOP_CELL_EDITING_PROPERTY definition code for javax.swing.JTree.INVOKES_STOP_CELL_EDITING_PROPERTY
          Bound property name for messagesStopCellEditing.
protected  boolean invokesStopCellEditing sample code for javax.swing.JTree.invokesStopCellEditing definition code for javax.swing.JTree.invokesStopCellEditing
          If true, when editing is to be stopped by way of selection changing, data in tree changing or other means stopCellEditing is invoked, and changes are saved.
static String sample code for java.lang.String definition code for java.lang.String LARGE_MODEL_PROPERTY sample code for javax.swing.JTree.LARGE_MODEL_PROPERTY definition code for javax.swing.JTree.LARGE_MODEL_PROPERTY
          Bound property name for largeModel.
protected  boolean largeModel sample code for javax.swing.JTree.largeModel definition code for javax.swing.JTree.largeModel
          Is this tree a large model? This is a code-optimization setting.
static String sample code for java.lang.String definition code for java.lang.String LEAD_SELECTION_PATH_PROPERTY sample code for javax.swing.JTree.LEAD_SELECTION_PATH_PROPERTY definition code for javax.swing.JTree.LEAD_SELECTION_PATH_PROPERTY
          Bound property name for leadSelectionPath.
static String sample code for java.lang.String definition code for java.lang.String ROOT_VISIBLE_PROPERTY sample code for javax.swing.JTree.ROOT_VISIBLE_PROPERTY definition code for javax.swing.JTree.ROOT_VISIBLE_PROPERTY
          Bound property name for rootVisible.
protected  boolean rootVisible sample code for javax.swing.JTree.rootVisible definition code for javax.swing.JTree.rootVisible
          True if the root node is displayed, false if its children are the highest visible nodes.
static String sample code for java.lang.String definition code for java.lang.String ROW_HEIGHT_PROPERTY sample code for javax.swing.JTree.ROW_HEIGHT_PROPERTY definition code for javax.swing.JTree.ROW_HEIGHT_PROPERTY
          Bound property name for rowHeight.
protected  int rowHeight sample code for javax.swing.JTree.rowHeight definition code for javax.swing.JTree.rowHeight
          Height to use for each display row.
static String sample code for java.lang.String definition code for java.lang.String SCROLLS_ON_EXPAND_PROPERTY sample code for javax.swing.JTree.SCROLLS_ON_EXPAND_PROPERTY definition code for javax.swing.JTree.SCROLLS_ON_EXPAND_PROPERTY
          Bound property name for scrollsOnExpand.
protected  boolean scrollsOnExpand sample code for javax.swing.JTree.scrollsOnExpand definition code for javax.swing.JTree.scrollsOnExpand
          If true, when a node is expanded, as many of the descendants are scrolled to be visible.
static String sample code for java.lang.String definition code for java.lang.String SELECTION_MODEL_PROPERTY sample code for javax.swing.JTree.SELECTION_MODEL_PROPERTY definition code for javax.swing.JTree.SELECTION_MODEL_PROPERTY
          Bound property name for selectionModel.
protected  TreeSelectionModel sample code for javax.swing.tree.TreeSelectionModel definition code for javax.swing.tree.TreeSelectionModel selectionModel sample code for javax.swing.JTree.selectionModel definition code for javax.swing.JTree.selectionModel
          Models the set of selected nodes in this tree.
protected  JTree.TreeSelectionRedirector sample code for javax.swing.JTree.TreeSelectionRedirector definition code for javax.swing.JTree.TreeSelectionRedirector selectionRedirector sample code for javax.swing.JTree.selectionRedirector definition code for javax.swing.JTree.selectionRedirector
          Creates a new event and passed it off the selectionListeners.
static String sample code for java.lang.String definition code for java.lang.String SHOWS_ROOT_HANDLES_PROPERTY sample code for javax.swing.JTree.SHOWS_ROOT_HANDLES_PROPERTY definition code for javax.swing.JTree.SHOWS_ROOT_HANDLES_PROPERTY
          Bound property name for showsRootHandles.
protected  boolean showsRootHandles sample code for javax.swing.JTree.showsRootHandles definition code for javax.swing.JTree.showsRootHandles
          True if handles are displayed at the topmost level of the tree.
static String sample code for java.lang.String definition code for java.lang.String TOGGLE_CLICK_COUNT_PROPERTY sample code for javax.swing.JTree.TOGGLE_CLICK_COUNT_PROPERTY definition code for javax.swing.JTree.TOGGLE_CLICK_COUNT_PROPERTY
          Bound property name for toggleClickCount.
protected  int toggleClickCount sample code for javax.swing.JTree.toggleClickCount definition code for javax.swing.JTree.toggleClickCount
          Number of mouse clicks before a node is expanded.
static String sample code for java.lang.String definition code for java.lang.String TREE_MODEL_PROPERTY sample code for javax.swing.JTree.TREE_MODEL_PROPERTY definition code for javax.swing.JTree.TREE_MODEL_PROPERTY
          Bound property name for treeModel.
protected  TreeModel sample code for javax.swing.tree.TreeModel definition code for javax.swing.tree.TreeModel treeModel sample code for javax.swing.JTree.treeModel definition code for javax.swing.JTree.treeModel
          The model that defines the tree displayed by this object.
protected  TreeModelListener sample code for javax.swing.event.TreeModelListener definition code for javax.swing.event.TreeModelListener treeModelListener sample code for javax.swing.JTree.treeModelListener definition code for javax.swing.JTree.treeModelListener
          Updates the expandedState.
static String sample code for java.lang.String definition code for java.lang.String VISIBLE_ROW_COUNT_PROPERTY sample code for javax.swing.JTree.VISIBLE_ROW_COUNT_PROPERTY definition code for javax.swing.JTree.VISIBLE_ROW_COUNT_PROPERTY
          Bound property name for visibleRowCount.
protected  int visibleRowCount sample code for javax.swing.JTree.visibleRowCount definition code for javax.swing.JTree.visibleRowCount
          Number of rows to make visible at one time.
 
Fields inherited from class javax.swing.JComponent sample code for javax.swing.JComponent definition code for javax.swing.JComponent
accessibleContext sample code for javax.swing.JComponent.accessibleContext definition code for javax.swing.JComponent.accessibleContext , listenerList sample code for javax.swing.JComponent.listenerList definition code for javax.swing.JComponent.listenerList , TOOL_TIP_TEXT_KEY sample code for javax.swing.JComponent.TOOL_TIP_TEXT_KEY definition code for javax.swing.JComponent.TOOL_TIP_TEXT_KEY , ui sample code for javax.swing.JComponent.ui definition code for javax.swing.JComponent.ui , UNDEFINED_CONDITION sample code for javax.swing.JComponent.UNDEFINED_CONDITION definition code for javax.swing.JComponent.UNDEFINED_CONDITION , WHEN_ANCESTOR_OF_FOCUSED_COMPONENT sample code for javax.swing.JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT definition code for javax.swing.JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT , WHEN_FOCUSED sample code for javax.swing.JComponent.WHEN_FOCUSED definition code for javax.swing.JComponent.WHEN_FOCUSED , WHEN_IN_FOCUSED_WINDOW sample code for javax.swing.JComponent.WHEN_IN_FOCUSED_WINDOW definition code for javax.swing.JComponent.WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component sample code for java.awt.Component definition code for java.awt.Component
BOTTOM_ALIGNMENT sample code for java.awt.Component.BOTTOM_ALIGNMENT definition code for java.awt.Component.BOTTOM_ALIGNMENT , CENTER_ALIGNMENT sample code for java.awt.Component.CENTER_ALIGNMENT definition code for java.awt.Component.CENTER_ALIGNMENT , LEFT_ALIGNMENT sample code for java.awt.Component.LEFT_ALIGNMENT definition code for java.awt.Component.LEFT_ALIGNMENT , RIGHT_ALIGNMENT sample code for java.awt.Component.RIGHT_ALIGNMENT definition code for java.awt.Component.RIGHT_ALIGNMENT , TOP_ALIGNMENT sample code for java.awt.Component.TOP_ALIGNMENT definition code for java.awt.Component.TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver sample code for java.awt.image.ImageObserver definition code for java.awt.image.ImageObserver
ABORT sample code for java.awt.image.ImageObserver.ABORT definition code for java.awt.image.ImageObserver.ABORT , ALLBITS sample code for java.awt.image.ImageObserver.ALLBITS definition code for java.awt.image.ImageObserver.ALLBITS , ERROR sample code for java.awt.image.ImageObserver.ERROR definition code for java.awt.image.ImageObserver.ERROR , FRAMEBITS sample code for java.awt.image.ImageObserver.FRAMEBITS definition code for java.awt.image.ImageObserver.FRAMEBITS , HEIGHT sample code for java.awt.image.ImageObserver.HEIGHT definition code for java.awt.image.ImageObserver.HEIGHT , PROPERTIES sample code for java.awt.image.ImageObserver.PROPERTIES definition code for java.awt.image.ImageObserver.PROPERTIES , SOMEBITS sample code for java.awt.image.ImageObserver.SOMEBITS definition code for java.awt.image.ImageObserver.SOMEBITS , WIDTH sample code for java.awt.image.ImageObserver.WIDTH definition code for java.awt.image.ImageObserver.WIDTH
 
Constructor Summary
JTree sample code for javax.swing.JTree.JTree() definition code for javax.swing.JTree.JTree() ()
          Returns a JTree with a sample model.
JTree sample code for javax.swing.JTree.JTree(java.util.Hashtable) definition code for javax.swing.JTree.JTree(java.util.Hashtable) (Hashtable sample code for java.util.Hashtable definition code for java.util.Hashtable <?,?> value)
          Returns a JTree created from a Hashtable which does not display with root.
JTree sample code for javax.swing.JTree.JTree(java.lang.Object[]) definition code for javax.swing.JTree.JTree(java.lang.Object[]) (Object sample code for java.lang.Object definition code for java.lang.Object [] value)
          Returns a JTree with each element of the specified array as the child of a new root node which is not displayed.
JTree sample code for javax.swing.JTree.JTree(javax.swing.tree.TreeModel) definition code for javax.swing.JTree.JTree(javax.swing.tree.TreeModel) (TreeModel sample code for javax.swing.tree.TreeModel definition code for javax.swing.tree.TreeModel  newModel)
          Returns an instance of JTree which displays the root node -- the tree is created using the specified data model.
JTree sample code for javax.swing.JTree.JTree(javax.swing.tree.TreeNode) definition code for javax.swing.JTree.JTree(javax.swing.tree.TreeNode) (TreeNode sample code for javax.swing.tree.TreeNode definition code for javax.swing.tree.TreeNode  root)
          Returns a JTree with the specified TreeNode as its root, which displays the root node.
JTree sample code for javax.swing.JTree.JTree(javax.swing.tree.TreeNode, boolean) definition code for javax.swing.JTree.JTree(javax.swing.tree.TreeNode, boolean) (TreeNode sample code for javax.swing.tree.TreeNode definition code for javax.swing.tree.TreeNode  root, boolean asksAllowsChildren)
          Returns a JTree with the specified TreeNode as its root, which displays the root node and which decides whether a node is a leaf node in the specified manner.
JTree sample code for javax.swing.JTree.JTree(java.util.Vector) definition code for javax.swing.JTree.JTree(java.util.Vector) (Vector sample code for java.util.Vector definition code for java.util.Vector <?> value)
          Returns a JTree with each element of the specified Vector as the child of a new root node which is not displayed.
 
Method Summary
 void addSelectionInterval sample code for javax.swing.JTree.addSelectionInterval(int, int) definition code for javax.swing.JTree.addSelectionInterval(int, int) (int index0, int index1)
          Adds the paths between index0 and index1, inclusive, to the selection.
 void addSelectionPath sample code for javax.swing.JTree.addSelectionPath(javax.swing.tree.TreePath) definition code for javax.swing.JTree.addSelectionPath(javax.swing.tree.TreePath) (TreePath sample code for javax.swing.tree.TreePath definition code for javax.swing.tree.TreePath  path)
          Adds the node identified by the specified TreePath to the current selection.
 void addSelectionPaths sample code for javax.swing.JTree.addSelectionPaths(javax.swing.tree.TreePath[]) definition code for javax.swing.JTree.addSelectionPaths(javax.swing.tree.TreePath[]) (TreePath sample code for javax.swing.tree.TreePath definition code for javax.swing.tree.TreePath [] paths)
          Adds each path in the array of paths to the current selection.
 void addSelectionRow sample code for javax.swing.JTree.addSelectionRow(int) definition code for javax.swing.JTree.addSelectionRow(int) (int row)
          Adds the path at the specified row to the current selection.
 void addSelectionRows sample code for javax.swing.JTree.addSelectionRows(int[]) definition code for javax.swing.JTree.addSelectionRows(int[]) (int[] rows)
          Adds the paths at each of the specified rows to the current selection.
 void addTreeExpansionListener sample code for javax.swing.JTree.addTreeExpansionListener(javax.swing.event.TreeExpansionListener) definition code for javax.swing.JTree.addTreeExpansionListener(javax.swing.event.TreeExpansionListener) (TreeExpansionListener sample code for javax.swing.event.TreeExpansionListener definition code for javax.swing.event.TreeExpansionListener  tel)
          Adds a listener for TreeExpansion events.
 void addTreeSelectionListener sample code for javax.swing.JTree.addTreeSelectionListener(javax.swing.event.TreeSelectionListener) definition code for javax.swing.JTree.addTreeSelectionListener(javax.swing.event.TreeSelectionListener) (TreeSelectionListener sample code for javax.swing.event.TreeSelectionListener definition code for javax.swing.event.TreeSelectionListener  tsl)
          Adds a listener for TreeSelection events.
 void addTreeWillExpandListener sample code for javax.swing.JTree.addTreeWillExpandListener(javax.swing.event.TreeWillExpandListener) definition code for javax.swing.JTree.addTreeWillExpandListener(javax.swing.event.TreeWillExpandListener) (TreeWillExpandListener sample code for javax.swing.event.TreeWillExpandListener definition code for javax.swing.event.TreeWillExpandListener  tel)
          Adds a listener for TreeWillExpand events.
 void cancelEditing sample code for javax.swing.JTree.cancelEditing() definition code for javax.swing.JTree.cancelEditing() ()
          Cancels the current editing session.
 void clearSelection sample code for javax.swing.JTree.clearSelection() definition code for javax.swing.JTree.clearSelection() ()
          Clears the selection.
protected  void clearToggledPaths sample code for javax.swing.JTree.clearToggledPaths() definition code for javax.swing.JTree.clearToggledPaths() ()
          Clears the cache of toggled tree paths.
 void collapsePath sample code for javax.swing.JTree.collapsePath(javax.swing.tree.TreePath) definition code for javax.swing.JTree.collapsePath(javax.swing.tree.TreePath) (TreePath sample code for javax.swing.tree.TreePath definition code for javax.swing.tree.TreePath  path)
          Ensures that the node identified by the specified path is collapsed and viewable.
 void collapseRow sample code for javax.swing.JTree.collapseRow(int) definition code for javax.swing.JTree.collapseRow(int) (int row)
          Ensures that the node in the specified row is collapsed.
 String sample code for java.lang.String definition code for java.lang.String convertValueToText sample code for javax.swing.JTree.convertValueToText(java.lang.Object, boolean, boolean, boolean, int, boolean) definition code for javax.swing.JTree.convertValueToText(java.lang.Object, boolean, boolean, boolean, int, boolean) (Object sample code for java.lang.Object definition code for java.lang.Object  value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus)
          Called by the renderers to convert the specified value to text.
protected static TreeModel sample code for javax.swing.tree.TreeModel definition code for javax.swing.tree.TreeModel createTreeModel sample code for javax.swing.JTree.createTreeModel(java.lang.Object) definition code for javax.swing.JTree.createTreeModel(java.lang.Object) (Object sample code for java.lang.Object definition code for java.lang.Object  value)
          Returns a TreeModel wrapping the specified object.
protected  TreeModelListener sample code for javax.swing.event.TreeModelListener definition code for javax.swing.event.TreeModelListener createTreeModelListener sample code for javax.swing.JTree.createTreeModelListener() definition code for javax.swing.JTree.createTreeModelListener() ()
          Creates and returns an instance of TreeModelHandler.
 void expandPath sample code for javax.swing.JTree.expandPath(javax.swing.tree.TreePath) definition code for javax.swing.JTree.expandPath(javax.swing.tree.TreePath) (TreePath sample code for javax.swing.tree.TreePath definition code for javax.swing.tree.TreePath  path)
          Ensures that the node identified by the specified path is expanded and viewable.
 void expandRow sample code for javax.swing.JTree.expandRow(int) definition code for javax.swing.JTree.expandRow(int) (int row)
          Ensures that the node in the specified row is expanded and viewable.
 void fireTreeCollapsed sample code for javax.swing.JTree.fireTreeCollapsed(javax.swing.tree.TreePath) definition code for javax.swing.JTree.fireTreeCollapsed(javax.swing.tree.TreePath)