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) (TreePath sample code for javax.swing.tree.TreePath definition code for javax.swing.tree.TreePath  path)
          Notifies all listeners that have registered interest for notification on this event type.
 void fireTreeExpanded sample code for javax.swing.JTree.fireTreeExpanded(javax.swing.tree.TreePath) definition code for javax.swing.JTree.fireTreeExpanded(javax.swing.tree.TreePath) (TreePath sample code for javax.swing.tree.TreePath definition code for javax.swing.tree.TreePath  path)
          Notifies all listeners that have registered interest for notification on this event type.
 void fireTreeWillCollapse sample code for javax.swing.JTree.fireTreeWillCollapse(javax.swing.tree.TreePath) definition code for javax.swing.JTree.fireTreeWillCollapse(javax.swing.tree.TreePath) (TreePath sample code for javax.swing.tree.TreePath definition code for javax.swing.tree.TreePath  path)
          Notifies all listeners that have registered interest for notification on this event type.
 void fireTreeWillExpand sample code for javax.swing.JTree.fireTreeWillExpand(javax.swing.tree.TreePath) definition code for javax.swing.JTree.fireTreeWillExpand(javax.swing.tree.TreePath) (TreePath sample code for javax.swing.tree.TreePath definition code for javax.swing.tree.TreePath  path)
          Notifies all listeners that have registered interest for notification on this event type.
protected  void fireValueChanged sample code for javax.swing.JTree.fireValueChanged(javax.swing.event.TreeSelectionEvent) definition code for javax.swing.JTree.fireValueChanged(javax.swing.event.TreeSelectionEvent) (TreeSelectionEvent sample code for javax.swing.event.TreeSelectionEvent definition code for javax.swing.event.TreeSelectionEvent  e)
          Notifies all listeners that have registered interest for notification on this event type.
 AccessibleContext sample code for javax.accessibility.AccessibleContext definition code for javax.accessibility.AccessibleContext getAccessibleContext sample code for javax.swing.JTree.getAccessibleContext() definition code for javax.swing.JTree.getAccessibleContext() ()
          Gets the AccessibleContext associated with this JTree.
 TreePath sample code for javax.swing.tree.TreePath definition code for javax.swing.tree.TreePath getAnchorSelectionPath sample code for javax.swing.JTree.getAnchorSelectionPath() definition code for javax.swing.JTree.getAnchorSelectionPath() ()
          Returns the path identified as the anchor.
 TreeCellEditor sample code for javax.swing.tree.TreeCellEditor definition code for javax.swing.tree.TreeCellEditor getCellEditor sample code for javax.swing.JTree.getCellEditor() definition code for javax.swing.JTree.getCellEditor() ()
          Returns the editor used to edit entries in the tree.
 TreeCellRenderer sample code for javax.swing.tree.TreeCellRenderer definition code for javax.swing.tree.TreeCellRenderer getCellRenderer sample code for javax.swing.JTree.getCellRenderer() definition code for javax.swing.JTree.getCellRenderer() ()
          Returns the current TreeCellRenderer that is rendering each cell.
 TreePath sample code for javax.swing.tree.TreePath definition code for javax.swing.tree.TreePath getClosestPathForLocation sample code for javax.swing.JTree.getClosestPathForLocation(int, int) definition code for javax.swing.JTree.getClosestPathForLocation(int, int) (int x, int y)
          Returns the path to the node that is closest to x,y.
 int getClosestRowForLocation sample code for javax.swing.JTree.getClosestRowForLocation(int, int) definition code for javax.swing.JTree.getClosestRowForLocation(int, int) (int x, int y)
          Returns the row to the node that is closest to x,y.
protected static TreeModel sample code for javax.swing.tree.TreeModel definition code for javax.swing.tree.TreeModel getDefaultTreeModel sample code for javax.swing.JTree.getDefaultTreeModel() definition code for javax.swing.JTree.getDefaultTreeModel() ()
          Creates and returns a sample TreeModel.
protected  Enumeration sample code for java.util.Enumeration definition code for java.util.Enumeration <TreePath sample code for javax.swing.tree.TreePath definition code for javax.swing.tree.TreePath > getDescendantToggledPaths sample code for javax.swing.JTree.getDescendantToggledPaths(javax.swing.tree.TreePath) definition code for javax.swing.JTree.getDescendantToggledPaths(javax.swing.tree.TreePath) (TreePath sample code for javax.swing.tree.TreePath definition code for javax.swing.tree.TreePath  parent)
          Returns an Enumeration of TreePaths that have been expanded that are descendants of parent.
 boolean getDragEnabled sample code for javax.swing.JTree.getDragEnabled() definition code for javax.swing.JTree.getDragEnabled() ()
          Gets the value of the dragEnabled property.
 TreePath sample code for javax.swing.tree.TreePath definition code for javax.swing.tree.TreePath getEditingPath sample code for javax.swing.JTree.getEditingPath() definition code for javax.swing.JTree.getEditingPath() ()
          Returns the path to the element that is currently being edited.
 Enumeration sample code for java.util.Enumeration definition code for java.util.Enumeration <TreePath sample code for javax.swing.tree.TreePath definition code for javax.swing.tree.TreePath > getExpandedDescendants sample code for javax.swing.JTree.getExpandedDescendants(javax.swing.tree.TreePath) definition code for javax.swing.JTree.getExpandedDescendants(javax.swing.tree.TreePath) (TreePath sample code for javax.swing.tree.TreePath definition code for javax.swing.tree.TreePath  parent)
          Returns an Enumeration of the descendants of the path parent that are currently expanded.
 boolean getExpandsSelectedPaths sample code for javax.swing.JTree.getExpandsSelectedPaths() definition code for javax.swing.JTree.getExpandsSelectedPaths() ()
          Returns the expandsSelectedPaths property.
 boolean getInvokesStopCellEditing sample code for javax.swing.JTree.getInvokesStopCellEditing() definition code for javax.swing.JTree.getInvokesStopCellEditing() ()
          Returns the indicator that tells what happens when editing is interrupted.
 Object sample code for java.lang.Object definition code for java.lang.Object getLastSelectedPathComponent sample code for javax.swing.JTree.getLastSelectedPathComponent() definition code for javax.swing.JTree.getLastSelectedPathComponent() ()
          Returns the last path component in the first node of the current selection.
 TreePath sample code for javax.swing.tree.TreePath definition code for javax.swing.tree.TreePath getLeadSelectionPath sample code for javax.swing.JTree.getLeadSelectionPath() definition code for javax.swing.JTree.getLeadSelectionPath() ()
          Returns the path identified as the lead.
 int getLeadSelectionRow sample code for javax.swing.JTree.getLeadSelectionRow() definition code for javax.swing.JTree.getLeadSelectionRow() ()
          Returns the row index corresponding to the lead path.
 int getMaxSelectionRow sample code for javax.swing.JTree.getMaxSelectionRow() definition code for javax.swing.JTree.getMaxSelectionRow() ()
          Returns the last selected row.
 int getMinSelectionRow sample code for javax.swing.JTree.getMinSelectionRow() definition code for javax.swing.JTree.getMinSelectionRow() ()
          Gets the first selected row.
 TreeModel sample code for javax.swing.tree.TreeModel definition code for javax.swing.tree.TreeModel getModel sample code for javax.swing.JTree.getModel() definition code for javax.swing.JTree.getModel() ()
          Returns the TreeModel that is providing the data.
 TreePath sample code for javax.swing.tree.TreePath definition code for javax.swing.tree.TreePath getNextMatch sample code for javax.swing.JTree.getNextMatch(java.lang.String, int, javax.swing.text.Position.Bias) definition code for javax.swing.JTree.getNextMatch(java.lang.String, int, javax.swing.text.Position.Bias) (String sample code for java.lang.String definition code for java.lang.String  prefix, int startingRow, Position.Bias sample code for javax.swing.text.Position.Bias definition code for javax.swing.text.Position.Bias  bias)
          Returns the TreePath to the next tree element that begins with a prefix.
protected  TreePath sample code for javax.swing.tree.TreePath definition code for javax.swing.tree.TreePath [] getPathBetweenRows sample code for javax.swing.JTree.getPathBetweenRows(int, int) definition code for javax.swing.JTree.getPathBetweenRows(int, int) (int index0, int index1)
          Returns JTreePath instances representing the path between index0 and index1 (including index1).
 Rectangle sample code for java.awt.Rectangle definition code for java.awt.Rectangle getPathBounds sample code for javax.swing.JTree.getPathBounds(javax.swing.tree.TreePath) definition code for javax.swing.JTree.getPathBounds(javax.swing.tree.TreePath) (TreePath sample code for javax.swing.tree.TreePath definition code for javax.swing.tree.TreePath  path)
          Returns the Rectangle that the specified node will be drawn into.
 TreePath sample code for javax.swing.tree.TreePath definition code for javax.swing.tree.TreePath getPathForLocation sample code for javax.swing.JTree.getPathForLocation(int, int) definition code for javax.swing.JTree.getPathForLocation(int, int) (int x, int y)
          Returns the path for the node at the specified location.
 TreePath sample code for javax.swing.tree.TreePath definition code for javax.swing.tree.TreePath getPathForRow sample code for javax.swing.JTree.getPathForRow(int) definition code for javax.swing.JTree.getPathForRow(int) (int row)
          Returns the path for the specified row.
 Dimension sample code for java.awt.Dimension definition code for java.awt.Dimension getPreferredScrollableViewportSize sample code for javax.swing.JTree.getPreferredScrollableViewportSize() definition code for javax.swing.JTree.getPreferredScrollableViewportSize() ()
          Returns the preferred display size of a JTree.
 Rectangle sample code for java.awt.Rectangle definition code for java.awt.Rectangle getRowBounds sample code for javax.swing.JTree.getRowBounds(int) definition code for javax.swing.JTree.getRowBounds(int) (int row)
          Returns the Rectangle that the node at the specified row is drawn in.
 int getRowCount sample code for javax.swing.JTree.getRowCount() definition code for javax.swing.JTree.getRowCount() ()
          Returns the number of rows that are currently being displayed.
 int getRowForLocation sample code for javax.swing.JTree.getRowForLocation(int, int) definition code for javax.swing.JTree.getRowForLocation(int, int) (int x, int y)
          Returns the row for the specified location.
 int getRowForPath sample code for javax.swing.JTree.getRowForPath(javax.swing.tree.TreePath) definition code for javax.swing.JTree.getRowForPath(javax.swing.tree.TreePath) (TreePath sample code for javax.swing.tree.TreePath definition code for javax.swing.tree.TreePath  path)
          Returns the row that displays the node identified by the specified path.
 int getRowHeight sample code for javax.swing.JTree.getRowHeight() definition code for javax.swing.JTree.getRowHeight() ()
          Returns the height of each row.
 int getScrollableBlockIncrement sample code for javax.swing.JTree.getScrollableBlockIncrement(java.awt.Rectangle, int, int) definition code for javax.swing.JTree.getScrollableBlockIncrement(java.awt.Rectangle, int, int) (Rectangle sample code for java.awt.Rectangle definition code for java.awt.Rectangle  visibleRect, int orientation, int direction)
          Returns the amount for a block increment, which is the height or width of visibleRect, based on orientation.
 boolean getScrollableTracksViewportHeight sample code for javax.swing.JTree.getScrollableTracksViewportHeight() definition code for javax.swing.JTree.getScrollableTracksViewportHeight() ()
          Returns false to indicate that the height of the viewport does not determine the height of the table, unless the preferred height of the tree is smaller than the viewports height.
 boolean getScrollableTracksViewportWidth sample code for javax.swing.JTree.getScrollableTracksViewportWidth() definition code for javax.swing.JTree.getScrollableTracksViewportWidth() ()
          Returns false to indicate that the width of the viewport does not determine the width of the table, unless the preferred width of the tree is smaller than the viewports width.
 int getScrollableUnitIncrement sample code for javax.swing.JTree.getScrollableUnitIncrement(java.awt.Rectangle, int, int) definition code for javax.swing.JTree.getScrollableUnitIncrement(java.awt.Rectangle, int, int) (Rectangle sample code for java.awt.Rectangle definition code for java.awt.Rectangle  visibleRect, int orientation, int direction)
          Returns the amount to increment when scrolling.
 boolean getScrollsOnExpand sample code for javax.swing.JTree.getScrollsOnExpand() definition code for javax.swing.JTree.getScrollsOnExpand() ()
          Returns the value of the scrollsOnExpand property.
 int getSelectionCount sample code for javax.swing.JTree.getSelectionCount() definition code for javax.swing.JTree.getSelectionCount() ()
          Returns the number of nodes selected.
 TreeSelectionModel sample code for javax.swing.tree.TreeSelectionModel definition code for javax.swing.tree.TreeSelectionModel getSelectionModel sample code for javax.swing.JTree.getSelectionModel() definition code for javax.swing.JTree.getSelectionModel() ()
          Returns the model for selections.
 TreePath sample code for javax.swing.tree.TreePath definition code for javax.swing.tree.TreePath getSelectionPath sample code for javax.swing.JTree.getSelectionPath() definition code for javax.swing.JTree.getSelectionPath() ()
          Returns the path to the first selected node.
 TreePath sample code for javax.swing.tree.TreePath definition code for javax.swing.tree.TreePath [] getSelectionPaths sample code for javax.swing.JTree.getSelectionPaths() definition code for javax.swing.JTree.getSelectionPaths() ()
          Returns the paths of all selected values.
 int[] getSelectionRows sample code for javax.swing.JTree.getSelectionRows() definition code for javax.swing.JTree.getSelectionRows() ()
          Returns all of the currently selected rows.
 boolean getShowsRootHandles sample code for javax.swing.JTree.getShowsRootHandles() definition code for javax.swing.JTree.getShowsRootHandles() ()
          Returns the value of the showsRootHandles property.
 int getToggleClickCount sample code for javax.swing.JTree.getToggleClickCount() definition code for javax.swing.JTree.getToggleClickCount() ()
          Returns the number of mouse clicks needed to expand or close a node.
 String sample code for java.lang.String definition code for java.lang.String getToolTipText sample code for javax.swing.JTree.getToolTipText(java.awt.event.MouseEvent) definition code for javax.swing.JTree.getToolTipText(java.awt.event.MouseEvent) (MouseEvent sample code for java.awt.event.MouseEvent definition code for java.awt.event.MouseEvent  event)
          Overrides JComponent's getToolTipText method in order to allow renderer's tips to be used if it has text set.
 TreeExpansionListener sample code for javax.swing.event.TreeExpansionListener definition code for javax.swing.event.TreeExpansionListener [] getTreeExpansionListeners sample code for javax.swing.JTree.getTreeExpansionListeners() definition code for javax.swing.JTree.getTreeExpansionListeners() ()
          Returns an array of all the TreeExpansionListeners added to this JTree with addTreeExpansionListener().
 TreeSelectionListener sample code for javax.swing.event.TreeSelectionListener definition code for javax.swing.event.TreeSelectionListener [] getTreeSelectionListeners sample code for javax.swing.JTree.getTreeSelectionListeners() definition code for javax.swing.JTree.getTreeSelectionListeners() ()
          Returns an array of all the TreeSelectionListeners added to this JTree with addTreeSelectionListener().
 TreeWillExpandListener sample code for javax.swing.event.TreeWillExpandListener definition code for javax.swing.event.TreeWillExpandListener [] getTreeWillExpandListeners sample code for javax.swing.JTree.getTreeWillExpandListeners() definition code for javax.swing.JTree.getTreeWillExpandListeners() ()
          Returns an array of all the TreeWillExpandListeners added to this JTree with addTreeWillExpandListener().
 TreeUI sample code for javax.swing.plaf.TreeUI definition code for javax.swing.plaf.TreeUI getUI sample code for javax.swing.JTree.getUI() definition code for javax.swing.JTree.getUI() ()
          Returns the L&F object that renders this component.
 String sample code for java.lang.String definition code for java.lang.String getUIClassID sample code for javax.swing.JTree.getUIClassID() definition code for javax.swing.JTree.getUIClassID() ()
          Returns the name of the L&F class that renders this component.
 int getVisibleRowCount sample code for javax.swing.JTree.getVisibleRowCount() definition code for javax.swing.JTree.getVisibleRowCount() ()
          Returns the number of rows that are displayed in the display area.
 boolean hasBeenExpanded sample code for javax.swing.JTree.hasBeenExpanded(javax.swing.tree.TreePath) definition code for javax.swing.JTree.hasBeenExpanded(javax.swing.tree.TreePath) (TreePath sample code for javax.swing.tree.TreePath definition code for javax.swing.tree.TreePath  path)
          Returns true if the node identified by the path has ever been expanded.
 boolean isCollapsed sample code for javax.swing.JTree.isCollapsed(int) definition code for javax.swing.JTree.isCollapsed(int) (int row)
          Returns true if the node at the specified display row is collapsed.
 boolean isCollapsed sample code for javax.swing.JTree.isCollapsed(javax.swing.tree.TreePath) definition code for javax.swing.JTree.isCollapsed(javax.swing.tree.TreePath) (TreePath sample code for javax.swing.tree.TreePath definition code for javax.swing.tree.TreePath  path)
          Returns true if the value identified by path is currently collapsed, this will return false if any of the values in path are currently not being displayed.
 boolean isEditable sample code for javax.swing.JTree.isEditable() definition code for javax.swing.JTree.isEditable() ()
          Returns true if the tree is editable.
 boolean isEditing sample code for javax.swing.JTree.isEditing() definition code for javax.swing.JTree.isEditing() ()
          Returns true if the tree is being edited.
 boolean isExpanded sample code for javax.swing.JTree.isExpanded(int) definition code for javax.swing.JTree.isExpanded(int) (int row)
          Returns true if the node at the specified display row is currently expanded.
 boolean isExpanded sample code for javax.swing.JTree.isExpanded(javax.swing.tree.TreePath) definition code for javax.swing.JTree.isExpanded(javax.swing.tree.TreePath) (TreePath sample code for javax.swing.tree.TreePath definition code for javax.swing.tree.TreePath  path)
          Returns true if the node identified by the path is currently expanded,
 boolean isFixedRowHeight sample code for javax.swing.JTree.isFixedRowHeight() definition code for javax.swing.JTree.isFixedRowHeight() ()
          Returns true if the height of each display row is a fixed size.
 boolean isLargeModel sample code for javax.swing.JTree.isLargeModel() definition code for javax.swing.JTree.isLargeModel() ()
          Returns true if the tree is configured for a large model.
 boolean isPathEditable sample code for javax.swing.JTree.isPathEditable(javax.swing.tree.TreePath) definition code for javax.swing.JTree.isPathEditable(javax.swing.tree.TreePath) (TreePath sample code for javax.swing.tree.TreePath definition code for javax.swing.tree.TreePath  path)
          Returns isEditable.
 boolean isPathSelected sample code for javax.swing.JTree.isPathSelected(javax.swing.tree.TreePath) definition code for javax.swing.JTree.isPathSelected(javax.swing.tree.TreePath) (TreePath sample code for javax.swing.tree.TreePath definition code for javax.swing.tree.TreePath  path)
          Returns true if the item identified by the path is currently selected.
 boolean isRootVisible sample code for javax.swing.JTree.isRootVisible() definition code for javax.swing.JTree.isRootVisible() ()
          Returns true if the root node of the tree is displayed.
 boolean isRowSelected sample code for javax.swing.JTree.isRowSelected(int) definition code for javax.swing.JTree.isRowSelected(int) (int row)
          Returns true if the node identified by row is selected.
 boolean isSelectionEmpty sample code for javax.swing.JTree.isSelectionEmpty() definition code for javax.swing.JTree.isSelectionEmpty() ()
          Returns true if the selection is currently empty.
 boolean isVisible sample code for javax.swing.JTree.isVisible(javax.swing.tree.TreePath) definition code for javax.swing.JTree.isVisible(javax.swing.tree.TreePath) (TreePath sample code for javax.swing.tree.TreePath definition code for javax.swing.tree.TreePath  path)
          Returns true if the value identified by path is currently viewable, which means it is either the root or all of its parents are expanded.
 void makeVisible sample code for javax.swing.JTree.makeVisible(javax.swing.tree.TreePath) definition code for javax.swing.JTree.makeVisible(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 path is currently viewable.
protected  String sample code for java.lang.String definition code for java.lang.String paramString sample code for javax.swing.JTree.paramString() definition code for javax.swing.JTree.paramString() ()
          Returns a string representation of this JTree.
protected  boolean removeDescendantSelectedPaths sample code for javax.swing.JTree.removeDescendantSelectedPaths(javax.swing.tree.TreePath, boolean) definition code for javax.swing.JTree.removeDescendantSelectedPaths(javax.swing.tree.TreePath, boolean) (TreePath sample code for javax.swing.tree.TreePath definition code for javax.swing.tree.TreePath  path, boolean includePath)
          Removes any paths in the selection that are descendants of path.
protected  void removeDescendantToggledPaths sample code for javax.swing.JTree.removeDescendantToggledPaths(java.util.Enumeration) definition code for javax.swing.JTree.removeDescendantToggledPaths(java.util.Enumeration) (Enumeration sample code for java.util.Enumeration definition code for java.util.Enumeration <TreePath sample code for javax.swing.tree.TreePath definition code for javax.swing.tree.TreePath > toRemove)
          Removes any descendants of the TreePaths in toRemove that have been expanded.
 void removeSelectionInterval sample code for javax.swing.JTree.removeSelectionInterval(int, int) definition code for javax.swing.JTree.removeSelectionInterval(int, int) (int index0, int index1)
          Removes the nodes between index0 and index1, inclusive, from the selection.
 void removeSelectionPath sample code for javax.swing.JTree.removeSelectionPath(javax.swing.tree.TreePath) definition code for javax.swing.JTree.removeSelectionPath(javax.swing.tree.TreePath) (TreePath sample code for javax.swing.tree.TreePath definition code for javax.swing.tree.TreePath  path)
          Removes the node identified by the specified path from the current selection.
 void removeSelectionPaths sample code for javax.swing.JTree.removeSelectionPaths(javax.swing.tree.TreePath[]) definition code for javax.swing.JTree.removeSelectionPaths(javax.swing.tree.TreePath[]) (TreePath sample code for javax.swing.tree.TreePath definition code for javax.swing.tree.TreePath [] paths)
          Removes the nodes identified by the specified paths from the current selection.
 void removeSelectionRow sample code for javax.swing.JTree.removeSelectionRow(int) definition code for javax.swing.JTree.removeSelectionRow(int) (int row)
          Removes the row at the index row from the current selection.
 void removeSelectionRows sample code for javax.swing.JTree.removeSelectionRows(int[]) definition code for javax.swing.JTree.removeSelectionRows(int[]) (int[] rows)
          Removes the rows that are selected at each of the specified rows.
 void removeTreeExpansionListener sample code for javax.swing.JTree.removeTreeExpansionListener(javax.swing.event.TreeExpansionListener) definition code for javax.swing.JTree.removeTreeExpansionListener(javax.swing.event.TreeExpansionListener) (TreeExpansionListener sample code for javax.swing.event.TreeExpansionListener definition code for javax.swing.event.TreeExpansionListener  tel)
          Removes a listener for TreeExpansion events.
 void removeTreeSelectionListener sample code for javax.swing.JTree.removeTreeSelectionListener(javax.swing.event.TreeSelectionListener) definition code for javax.swing.JTree.removeTreeSelectionListener(javax.swing.event.TreeSelectionListener) (TreeSelectionListener sample code for javax.swing.event.TreeSelectionListener definition code for javax.swing.event.TreeSelectionListener  tsl)
          Removes a TreeSelection listener.
 void removeTreeWillExpandListener sample code for javax.swing.JTree.removeTreeWillExpandListener(javax.swing.event.TreeWillExpandListener) definition code for javax.swing.JTree.removeTreeWillExpandListener(javax.swing.event.TreeWillExpandListener) (TreeWillExpandListener sample code for javax.swing.event.TreeWillExpandListener definition code for javax.swing.event.TreeWillExpandListener  tel)
          Removes a listener for TreeWillExpand events.
 void scrollPathToVisible sample code for javax.swing.JTree.scrollPathToVisible(javax.swing.tree.TreePath) definition code for javax.swing.JTree.scrollPathToVisible(javax.swing.tree.TreePath) (TreePath sample code for javax.swing.tree.TreePath definition code for javax.swing.tree.TreePath  path)
          Makes sure all the path components in path are expanded (except for the last path component) and scrolls so that the node identified by the path is displayed.
 void scrollRowToVisible sample code for javax.swing.JTree.scrollRowToVisible(int) definition code for javax.swing.JTree.scrollRowToVisible(int) (int row)
          Scrolls the item identified by row until it is displayed.
 void setAnchorSelectionPath sample code for javax.swing.JTree.setAnchorSelectionPath(javax.swing.tree.TreePath) definition code for javax.swing.JTree.setAnchorSelectionPath(javax.swing.tree.TreePath) (TreePath sample code for javax.swing.tree.TreePath definition code for javax.swing.tree.TreePath  newPath)
          Sets the path identified as the anchor.
 void setCellEditor sample code for javax.swing.JTree.setCellEditor(javax.swing.tree.TreeCellEditor) definition code for javax.swing.JTree.setCellEditor(javax.swing.tree.TreeCellEditor) (TreeCellEditor sample code for javax.swing.tree.TreeCellEditor definition code for javax.swing.tree.TreeCellEditor  cellEditor)
          Sets the cell editor.
 void setCellRenderer sample code for javax.swing.JTree.setCellRenderer(javax.swing.tree.TreeCellRenderer) definition code for javax.swing.JTree.setCellRenderer(javax.swing.tree.TreeCellRenderer) (TreeCellRenderer sample code for javax.swing.tree.TreeCellRenderer definition code for javax.swing.tree.TreeCellRenderer  x)
          Sets the TreeCellRenderer that will be used to draw each cell.
 void setDragEnabled sample code for javax.swing.JTree.setDragEnabled(boolean) definition code for javax.swing.JTree.setDragEnabled(boolean) (boolean b)
          Sets the dragEnabled property, which must be true to enable automatic drag handling (the first part of drag and drop) on this component.
 void setEditable sample code for javax.swing.JTree.setEditable(boolean) definition code for javax.swing.JTree.setEditable(boolean) (boolean flag)
          Determines whether the tree is editable.
protected  void setExpandedState sample code for javax.swing.JTree.setExpandedState(javax.swing.tree.TreePath, boolean) definition code for javax.swing.JTree.setExpandedState(javax.swing.tree.TreePath, boolean) (TreePath sample code for javax.swing.tree.TreePath definition code for javax.swing.tree.TreePath  path, boolean state)
          Sets the expanded state of this JTree.
 void setExpandsSelectedPaths sample code for javax.swing.JTree.setExpandsSelectedPaths(boolean) definition code for javax.swing.JTree.setExpandsSelectedPaths(boolean) (boolean newValue)
          Configures the expandsSelectedPaths property.
 void setInvokesStopCellEditing sample code for javax.swing.JTree.setInvokesStopCellEditing(boolean) definition code for javax.swing.JTree.setInvokesStopCellEditing(boolean) (boolean newValue)
          Determines what happens when editing is interrupted by selecting another node in the tree, a change in the tree's data, or by some other means.
 void setLargeModel sample code for javax.swing.JTree.setLargeModel(boolean) definition code for javax.swing.JTree.setLargeModel(boolean) (boolean newValue)
          Specifies whether the UI should use a large model.
 void setLeadSelectionPath sample code for javax.swing.JTree.setLeadSelectionPath(javax.swing.tree.TreePath) definition code for javax.swing.JTree.setLeadSelectionPath(javax.swing.tree.TreePath) (TreePath sample code for javax.swing.tree.TreePath definition code for javax.swing.tree.TreePath  newPath)
          Sets the path identifies as the lead.
 void setModel sample code for javax.swing.JTree.setModel(javax.swing.tree.TreeModel) definition code for javax.swing.JTree.setModel(javax.swing.tree.TreeModel) (TreeModel sample code for javax.swing.tree.TreeModel definition code for javax.swing.tree.TreeModel  newModel)
          Sets the TreeModel that will provide the data.
 void setRootVisible sample code for javax.swing.JTree.setRootVisible(boolean) definition code for javax.swing.JTree.setRootVisible(boolean) (boolean rootVisible)
          Determines whether or not the root node from the TreeModel is visible.
 void setRowHeight sample code for javax.swing.JTree.setRowHeight(int) definition code for javax.swing.JTree.setRowHeight(int) (int rowHeight)
          Sets the height of each cell, in pixels.
 void setScrollsOnExpand sample code for javax.swing.JTree.setScrollsOnExpand(boolean) definition code for javax.swing.JTree.setScrollsOnExpand(boolean) (boolean newValue)
          Sets the scrollsOnExpand property, which determines whether the tree might scroll to show previously hidden children.
 void setSelectionInterval sample code for javax.swing.JTree.setSelectionInterval(int, int) definition code for javax.swing.JTree.setSelectionInterval(int, int) (int index0, int index1)
          Selects the nodes between index0 and index1, inclusive.
 void setSelectionModel sample code for javax.swing.JTree.setSelectionModel(javax.swing.tree.TreeSelectionModel) definition code for javax.swing.JTree.setSelectionModel(javax.swing.tree.TreeSelectionModel) (TreeSelectionModel sample code for javax.swing.tree.TreeSelectionModel definition code for javax.swing.tree.TreeSelectionModel  selectionModel)
          Sets the tree's selection model.
 void setSelectionPath sample code for javax.swing.JTree.setSelectionPath(javax.swing.tree.TreePath) definition code for javax.swing.JTree.setSelectionPath(javax.swing.tree.TreePath) (TreePath sample code for javax.swing.tree.TreePath definition code for javax.swing.tree.TreePath  path)
          Selects the node identified by the specified path.
 void setSelectionPaths sample code for javax.swing.JTree.setSelectionPaths(javax.swing.tree.TreePath[]) definition code for javax.swing.JTree.setSelectionPaths(javax.swing.tree.TreePath[]) (TreePath sample code for javax.swing.tree.TreePath definition code for javax.swing.tree.TreePath [] paths)
          Selects the nodes identified by the specified array of paths.
 void setSelectionRow sample code for javax.swing.JTree.setSelectionRow(int) definition code for javax.swing.JTree.setSelectionRow(int) (int row)
          Selects the node at the specified row in the display.
 void setSelectionRows sample code for javax.swing.JTree.setSelectionRows(int[]) definition code for javax.swing.JTree.setSelectionRows(int[]) (int[] rows)
          Selects the nodes corresponding to each of the specified rows in the display.
 void setShowsRootHandles sample code for javax.swing.JTree.setShowsRootHandles(boolean) definition code for javax.swing.JTree.setShowsRootHandles(boolean) (boolean newValue)
          Sets the value of the showsRootHandles property, which specifies whether the node handles should be displayed.
 void setToggleClickCount sample code for javax.swing.JTree.setToggleClickCount(int) definition code for javax.swing.JTree.setToggleClickCount(int) (int clickCount)
          Sets the number of mouse clicks before a node will expand or close.
 void setUI sample code for javax.swing.JTree.setUI(javax.swing.plaf.TreeUI) definition code for javax.swing.JTree.setUI(javax.swing.plaf.TreeUI) (TreeUI sample code for javax.swing.plaf.TreeUI definition code for javax.swing.plaf.TreeUI  ui)
          Sets the L&F object that renders this component.
 void setVisibleRowCount sample code for javax.swing.JTree.setVisibleRowCount(int) definition code for javax.swing.JTree.setVisibleRowCount(int) (int newCount)
          Sets the number of rows that are to be displayed.
 void startEditingAtPath sample code for javax.swing.JTree.startEditingAtPath(javax.swing.tree.TreePath) definition code for javax.swing.JTree.startEditingAtPath(javax.swing.tree.TreePath) (TreePath sample code for javax.swing.tree.TreePath definition code for javax.swing.tree.TreePath  path)
          Selects the node identified by the specified path and initiates editing.
 boolean stopEditing sample code for javax.swing.JTree.stopEditing() definition code for javax.swing.JTree.stopEditing() ()
          Ends the current editing session.
 void treeDidChange sample code for javax.swing.JTree.treeDidChange() definition code for javax.swing.JTree.treeDidChange() ()
          Sent when the tree has changed enough that we need to resize the bounds, but not enough that we need to remove the expanded node set (e.g nodes were expanded or collapsed, or nodes were inserted into the tree).
 void updateUI sample code for javax.swing.JTree.updateUI() definition code for javax.swing.JTree.updateUI() ()
          Notification from the UIManager that the L&F has changed.
 
Methods inherited from class javax.swing.JComponent sample code for javax.swing.JComponent definition code for javax.swing.JComponent
addAncestorListener sample code for javax.swing.JComponent.addAncestorListener(javax.swing.event.AncestorListener) definition code for javax.swing.JComponent.addAncestorListener(javax.swing.event.AncestorListener) , addNotify sample code for javax.swing.JComponent.addNotify() definition code for javax.swing.JComponent.addNotify() , addVetoableChangeListener sample code for javax.swing.JComponent.addVetoableChangeListener(java.beans.VetoableChangeListener) definition code for javax.swing.JComponent.addVetoableChangeListener(java.beans.VetoableChangeListener) , computeVisibleRect sample code for javax.swing.JComponent.computeVisibleRect(java.awt.Rectangle) definition code for javax.swing.JComponent.computeVisibleRect(java.awt.Rectangle) , contains sample code for javax.swing.JComponent.contains(int, int) definition code for javax.swing.JComponent.contains(int, int) , createToolTip sample code for javax.swing.JComponent.createToolTip() definition code for javax.swing.JComponent.createToolTip() , disable sample code for javax.swing.JComponent.disable() definition code for javax.swing.JComponent.disable() , enable sample code for javax.swing.JComponent.enable() definition code for javax.swing.JComponent.enable() , firePropertyChange sample code for javax.swing.JComponent.firePropertyChange(java.lang.String, boolean, boolean) definition code for javax.swing.JComponent.firePropertyChange(java.lang.String, boolean, boolean) , firePropertyChange sample code for javax.swing.JComponent.firePropertyChange(java.lang.String, char, char) definition code for javax.swing.JComponent.firePropertyChange(java.lang.String, char, char) , firePropertyChange sample code for javax.swing.JComponent.firePropertyChange(java.lang.String, int, int) definition code for javax.swing.JComponent.firePropertyChange(java.lang.String, int, int) , fireVetoableChange sample code for javax.swing.JComponent.fireVetoableChange(java.lang.String, java.lang.Object, java.lang.Object) definition code for javax.swing.JComponent.fireVetoableChange(java.lang.String, java.lang.Object, java.lang.Object) , getActionForKeyStroke sample code for javax.swing.JComponent.getActionForKeyStroke(javax.swing.KeyStroke) definition code for javax.swing.JComponent.getActionForKeyStroke(javax.swing.KeyStroke) , getActionMap sample code for javax.swing.JComponent.getActionMap() definition code for javax.swing.JComponent.getActionMap() , getAlignmentX sample code for javax.swing.JComponent.getAlignmentX() definition code for javax.swing.JComponent.getAlignmentX() , getAlignmentY sample code for javax.swing.JComponent.getAlignmentY() definition code for javax.swing.JComponent.getAlignmentY() , getAncestorListeners sample code for javax.swing.JComponent.getAncestorListeners() definition code for javax.swing.JComponent.getAncestorListeners() , getAutoscrolls sample code for javax.swing.JComponent.getAutoscrolls() definition code for javax.swing.JComponent.getAutoscrolls() , getBorder sample code for javax.swing.JComponent.getBorder() definition code for javax.swing.JComponent.getBorder() , getBounds sample code for javax.swing.JComponent.getBounds(java.awt.Rectangle) definition code for javax.swing.JComponent.getBounds(java.awt.Rectangle) , getClientProperty sample code for javax.swing.JComponent.getClientProperty(java.lang.Object) definition code for javax.swing.JComponent.getClientProperty(java.lang.Object) , getComponentGraphics sample code for javax.swing.JComponent.getComponentGraphics(java.awt.Graphics) definition code for javax.swing.JComponent.getComponentGraphics(java.awt.Graphics) , getComponentPopupMenu sample code for javax.swing.JComponent.getComponentPopupMenu() definition code for javax.swing.JComponent.getComponentPopupMenu() , getConditionForKeyStroke sample code for javax.swing.JComponent.getConditionForKeyStroke(javax.swing.KeyStroke) definition code for javax.swing.JComponent.getConditionForKeyStroke(javax.swing.KeyStroke) , getDebugGraphicsOptions sample code for javax.swing.JComponent.getDebugGraphicsOptions() definition code for javax.swing.JComponent.getDebugGraphicsOptions() , getDefaultLocale sample code for javax.swing.JComponent.getDefaultLocale() definition code for javax.swing.JComponent.getDefaultLocale() , getFontMetrics sample code for javax.swing.JComponent.getFontMetrics(java.awt.Font) definition code for javax.swing.JComponent.getFontMetrics(java.awt.Font) , getGraphics sample code for javax.swing.JComponent.getGraphics() definition code for javax.swing.JComponent.getGraphics() , getHeight sample code for javax.swing.JComponent.getHeight() definition code for javax.swing.JComponent.getHeight() , getInheritsPopupMenu sample code for javax.swing.JComponent.getInheritsPopupMenu() definition code for javax.swing.JComponent.getInheritsPopupMenu() , getInputMap sample code for javax.swing.JComponent.getInputMap() definition code for javax.swing.JComponent.getInputMap() , getInputMap sample code for javax.swing.JComponent.getInputMap(int) definition code for javax.swing.JComponent.getInputMap(int) , getInputVerifier sample code for javax.swing.JComponent.getInputVerifier() definition code for javax.swing.JComponent.getInputVerifier() , getInsets sample code for javax.swing.JComponent.getInsets() definition code for javax.swing.JComponent.getInsets() , getInsets sample code for javax.swing.JComponent.getInsets(java.awt.Insets) definition code for javax.swing.JComponent.getInsets(java.awt.Insets) , getListeners sample code for javax.swing.JComponent.getListeners(java.lang.Class) definition code for javax.swing.JComponent.getListeners(java.lang.Class) , getLocation sample code for javax.swing.JComponent.getLocation(java.awt.Point) definition code for javax.swing.JComponent.getLocation(java.awt.Point) , getMaximumSize sample code for javax.swing.JComponent.getMaximumSize() definition code for javax.swing.JComponent.getMaximumSize() , getMinimumSize sample code for javax.swing.JComponent.getMinimumSize() definition code for javax.swing.JComponent.getMinimumSize() , getNextFocusableComponent sample code for javax.swing.JComponent.getNextFocusableComponent() definition code for javax.swing.JComponent.getNextFocusableComponent() , getPopupLocation sample code for javax.swing.JComponent.getPopupLocation(java.awt.event.MouseEvent) definition code for javax.swing.JComponent.getPopupLocation(java.awt.event.MouseEvent) , getPreferredSize sample code for javax.swing.JComponent.getPreferredSize() definition code for javax.swing.JComponent.getPreferredSize() , getRegisteredKeyStrokes sample code for javax.swing.JComponent.getRegisteredKeyStrokes() definition code for javax.swing.JComponent.getRegisteredKeyStrokes() , getRootPane sample code for javax.swing.JComponent.getRootPane() definition code for javax.swing.JComponent.getRootPane() , getSize sample code for javax.swing.JComponent.getSize(java.awt.Dimension) definition code for javax.swing.JComponent.getSize(java.awt.Dimension) , getToolTipLocation sample code for javax.swing.JComponent.getToolTipLocation(java.awt.event.MouseEvent) definition code for javax.swing.JComponent.getToolTipLocation(java.awt.event.MouseEvent) , getToolTipText sample code for javax.swing.JComponent.getToolTipText() definition code for javax.swing.JComponent.getToolTipText() , getTopLevelAncestor sample code for javax.swing.JComponent.getTopLevelAncestor() definition code for javax.swing.JComponent.getTopLevelAncestor() , getTransferHandler sample code for javax.swing.JComponent.getTransferHandler() definition code for javax.swing.JComponent.getTransferHandler() , getVerifyInputWhenFocusTarget sample code for javax.swing.JComponent.getVerifyInputWhenFocusTarget() definition code for javax.swing.JComponent.getVerifyInputWhenFocusTarget() , getVetoableChangeListeners sample code for javax.swing.JComponent.getVetoableChangeListeners() definition code for javax.swing.JComponent.getVetoableChangeListeners() , getVisibleRect sample code for javax.swing.JComponent.getVisibleRect() definition code for javax.swing.JComponent.getVisibleRect() , getWidth sample code for javax.swing.JComponent.getWidth() definition code for javax.swing.JComponent.getWidth() , getX sample code for javax.swing.JComponent.getX() definition code for javax.swing.JComponent.getX() , getY sample code for javax.swing.JComponent.getY() definition code for javax.swing.JComponent.getY() , grabFocus sample code for javax.swing.JComponent.grabFocus() definition code for javax.swing.JComponent.grabFocus() , isDoubleBuffered sample code for javax.swing.JComponent.isDoubleBuffered() definition code for javax.swing.JComponent.isDoubleBuffered() , isLightweightComponent sample code for javax.swing.JComponent.isLightweightComponent(java.awt.Component) definition code for javax.swing.JComponent.isLightweightComponent(java.awt.Component) , isManagingFocus sample code for javax.swing.JComponent.isManagingFocus() definition code for javax.swing.JComponent.isManagingFocus() , isOpaque sample code for javax.swing.JComponent.isOpaque() definition code for javax.swing.JComponent.isOpaque() , isOptimizedDrawingEnabled sample code for javax.swing.JComponent.isOptimizedDrawingEnabled() definition code for javax.swing.JComponent.isOptimizedDrawingEnabled() , isPaintingTile sample code for javax.swing.JComponent.isPaintingTile() definition code for javax.swing.JComponent.isPaintingTile() , isRequestFocusEnabled sample code for javax.swing.JComponent.isRequestFocusEnabled() definition code for javax.swing.JComponent.isRequestFocusEnabled() , isValidateRoot sample code for javax.swing.JComponent.isValidateRoot() definition code for javax.swing.JComponent.isValidateRoot() , paint sample code for javax.swing.JComponent.paint(java.awt.Graphics) definition code for javax.swing.JComponent.paint(java.awt.Graphics) , paintBorder sample code for javax.swing.JComponent.paintBorder(java.awt.Graphics) definition code for javax.swing.JComponent.paintBorder(java.awt.Graphics) , paintChildren sample code for javax.swing.JComponent.paintChildren(java.awt.Graphics) definition code for javax.swing.JComponent.paintChildren(java.awt.Graphics) , paintComponent sample code for javax.swing.JComponent.paintComponent(java.awt.Graphics) definition code for javax.swing.JComponent.paintComponent(java.awt.Graphics) , paintImmediately sample code for javax.swing.JComponent.paintImmediately(int, int, int, int) definition code for javax.swing.JComponent.paintImmediately(int, int, int, int) , paintImmediately sample code for javax.swing.JComponent.paintImmediately(java.awt.Rectangle) definition code for javax.swing.JComponent.paintImmediately(java.awt.Rectangle) , print sample code for javax.swing.JComponent.print(java.awt.Graphics) definition code for javax.swing.JComponent.print(java.awt.Graphics) , printAll sample code for javax.swing.JComponent.printAll(java.awt.Graphics) definition code for javax.swing.JComponent.printAll(java.awt.Graphics) , printBorder sample code for javax.swing.JComponent.printBorder(java.awt.Graphics) definition code for javax.swing.JComponent.printBorder(java.awt.Graphics) , printChildren sample code for javax.swing.JComponent.printChildren(java.awt.Graphics) definition code for javax.swing.JComponent.printChildren(java.awt.Graphics) , printComponent sample code for javax.swing.JComponent.printComponent(java.awt.Graphics) definition code for javax.swing.JComponent.printComponent(java.awt.Graphics) , processComponentKeyEvent sample code for javax.swing.JComponent.processComponentKeyEvent(java.awt.event.KeyEvent) definition code for javax.swing.JComponent.processComponentKeyEvent(java.awt.event.KeyEvent) , processKeyBinding sample code for javax.swing.JComponent.processKeyBinding(javax.swing.KeyStroke, java.awt.event.KeyEvent, int, boolean) definition code for javax.swing.JComponent.processKeyBinding(javax.swing.KeyStroke, java.awt.event.KeyEvent, int, boolean) , processKeyEvent sample code for javax.swing.JComponent.processKeyEvent(java.awt.event.KeyEvent) definition code for javax.swing.JComponent.processKeyEvent(java.awt.event.KeyEvent) , processMouseEvent sample code for javax.swing.JComponent.processMouseEvent(java.awt.event.MouseEvent) definition code for javax.swing.JComponent.processMouseEvent(java.awt.event.MouseEvent) , processMouseMotionEvent sample code for javax.swing.JComponent.processMouseMotionEvent(java.awt.event.MouseEvent) definition code for javax.swing.JComponent.processMouseMotionEvent(java.awt.event.MouseEvent) , putClientProperty sample code for javax.swing.JComponent.putClientProperty(java.lang.Object, java.lang.Object) definition code for javax.swing.JComponent.putClientProperty(java.lang.Object, java.lang.Object) , registerKeyboardAction sample code for javax.swing.JComponent.registerKeyboardAction(java.awt.event.ActionListener, javax.swing.KeyStroke, int) definition code for javax.swing.JComponent.registerKeyboardAction(java.awt.event.ActionListener, javax.swing.KeyStroke, int) , registerKeyboardAction sample code for javax.swing.JComponent.registerKeyboardAction(java.awt.event.ActionListener, java.lang.String, javax.swing.KeyStroke, int) definition code for javax.swing.JComponent.registerKeyboardAction(java.awt.event.ActionListener, java.lang.String, javax.swing.KeyStroke, int) , removeAncestorListener sample code for javax.swing.JComponent.removeAncestorListener(javax.swing.event.AncestorListener) definition code for javax.swing.JComponent.removeAncestorListener(javax.swing.event.AncestorListener) , removeNotify sample code for javax.swing.JComponent.removeNotify() definition code for javax.swing.JComponent.removeNotify() , removeVetoableChangeListener sample code for javax.swing.JComponent.removeVetoableChangeListener(java.beans.VetoableChangeListener) definition code for javax.swing.JComponent.removeVetoableChangeListener(java.beans.VetoableChangeListener) , repaint sample code for javax.swing.JComponent.repaint(long, int, int, int, int) definition code for javax.swing.JComponent.repaint(long, int, int, int, int) , repaint sample code for javax.swing.JComponent.repaint(java.awt.Rectangle) definition code for javax.swing.JComponent.repaint(java.awt.Rectangle) , requestDefaultFocus sample code for javax.swing.JComponent.requestDefaultFocus() definition code for javax.swing.JComponent.requestDefaultFocus() , requestFocus sample code for javax.swing.JComponent.requestFocus() definition code for javax.swing.JComponent.requestFocus() , requestFocus sample code for javax.swing.JComponent.requestFocus(boolean) definition code for javax.swing.JComponent.requestFocus(boolean) , requestFocusInWindow sample code for javax.swing.JComponent.requestFocusInWindow() definition code for javax.swing.JComponent.requestFocusInWindow() , requestFocusInWindow sample code for javax.swing.JComponent.requestFocusInWindow(boolean) definition code for javax.swing.JComponent.requestFocusInWindow(boolean) , resetKeyboardActions sample code for javax.swing.JComponent.resetKeyboardActions() definition code for javax.swing.JComponent.resetKeyboardActions() , reshape sample code for javax.swing.JComponent.reshape(int, int, int, int) definition code for javax.swing.JComponent.reshape(int, int, int, int) , revalidate sample code for javax.swing.JComponent.revalidate() definition code for javax.swing.JComponent.revalidate() , scrollRectToVisible sample code for javax.swing.JComponent.scrollRectToVisible(java.awt.Rectangle) definition code for javax.swing.JComponent.scrollRectToVisible(java.awt.Rectangle) , setActionMap sample code for javax.swing.JComponent.setActionMap(javax.swing.ActionMap) definition code for javax.swing.JComponent.setActionMap(javax.swing.ActionMap) , setAlignmentX sample code for javax.swing.JComponent.setAlignmentX(float) definition code for javax.swing.JComponent.setAlignmentX(float) , setAlignmentY sample code for javax.swing.JComponent.setAlignmentY(float) definition code for javax.swing.JComponent.setAlignmentY(float) , setAutoscrolls sample code for javax.swing.JComponent.setAutoscrolls(boolean) definition code for javax.swing.JComponent.setAutoscrolls(boolean) , setBackground sample code for javax.swing.JComponent.setBackground(java.awt.Color) definition code for javax.swing.JComponent.setBackground(java.awt.Color) , setBorder sample code for javax.swing.JComponent.setBorder(javax.swing.border.Border) definition code for javax.swing.JComponent.setBorder(javax.swing.border.Border) , setComponentPopupMenu sample code for javax.swing.JComponent.setComponentPopupMenu(javax.swing.JPopupMenu) definition code for javax.swing.JComponent.setComponentPopupMenu(javax.swing.JPopupMenu) , setDebugGraphicsOptions sample code for javax.swing.JComponent.setDebugGraphicsOptions(int) definition code for javax.swing.JComponent.setDebugGraphicsOptions(int) , setDefaultLocale sample code for javax.swing.JComponent.setDefaultLocale(java.util.Locale) definition code for javax.swing.JComponent.setDefaultLocale(java.util.Locale) , setDoubleBuffered sample code for javax.swing.JComponent.setDoubleBuffered(boolean) definition code for javax.swing.JComponent.setDoubleBuffered(boolean) , setEnabled sample code for javax.swing.JComponent.setEnabled(boolean) definition code for javax.swing.JComponent.setEnabled(boolean) , setFocusTraversalKeys sample code for javax.swing.JComponent.setFocusTraversalKeys(int, java.util.Set) definition code for javax.swing.JComponent.setFocusTraversalKeys(int, java.util.Set) , setFont sample code for javax.swing.JComponent.setFont(java.awt.Font) definition code for javax.swing.JComponent.setFont(java.awt.Font) , setForeground sample code for javax.swing.JComponent.setForeground(java.awt.Color) definition code for javax.swing.JComponent.setForeground(java.awt.Color) , setInheritsPopupMenu sample code for javax.swing.JComponent.setInheritsPopupMenu(boolean) definition code for javax.swing.JComponent.setInheritsPopupMenu(boolean) , setInputMap sample code for javax.swing.JComponent.setInputMap(int, javax.swing.InputMap) definition code for javax.swing.JComponent.setInputMap(int, javax.swing.InputMap) , setInputVerifier sample code for javax.swing.JComponent.setInputVerifier(javax.swing.InputVerifier) definition code for javax.swing.JComponent.setInputVerifier(javax.swing.InputVerifier) , setMaximumSize sample code for javax.swing.JComponent.setMaximumSize(java.awt.Dimension) definition code for javax.swing.JComponent.setMaximumSize(java.awt.Dimension) , setMinimumSize sample code for javax.swing.JComponent.setMinimumSize(java.awt.Dimension) definition code for javax.swing.JComponent.setMinimumSize(java.awt.Dimension) , setNextFocusableComponent sample code for javax.swing.JComponent.setNextFocusableComponent(java.awt.Component) definition code for javax.swing.JComponent.setNextFocusableComponent(java.awt.Component) , setOpaque sample code for javax.swing.JComponent.setOpaque(boolean) definition code for javax.swing.JComponent.setOpaque(boolean) , setPreferredSize sample code for javax.swing.JComponent.setPreferredSize(java.awt.Dimension) definition code for javax.swing.JComponent.setPreferredSize(java.awt.Dimension) , setRequestFocusEnabled sample code for javax.swing.JComponent.setRequestFocusEnabled(boolean) definition code for javax.swing.JComponent.setRequestFocusEnabled(boolean) , setToolTipText sample code for javax.swing.JComponent.setToolTipText(java.lang.String) definition code for javax.swing.JComponent.setToolTipText(java.lang.String) , setTransferHandler sample code for javax.swing.JComponent.setTransferHandler(javax.swing.TransferHandler) definition code for javax.swing.JComponent.setTransferHandler(javax.swing.TransferHandler) , setUI sample code for javax.swing.JComponent.setUI(javax.swing.plaf.ComponentUI) definition code for javax.swing.JComponent.setUI(javax.swing.plaf.ComponentUI) , setVerifyInputWhenFocusTarget sample code for javax.swing.JComponent.setVerifyInputWhenFocusTarget(boolean) definition code for javax.swing.JComponent.setVerifyInputWhenFocusTarget(boolean) , setVisible sample code for javax.swing.JComponent.setVisible(boolean) definition code for javax.swing.JComponent.setVisible(boolean) , unregisterKeyboardAction sample code for javax.swing.JComponent.unregisterKeyboardAction(javax.swing.KeyStroke) definition code for javax.swing.JComponent.unregisterKeyboardAction(javax.swing.KeyStroke) , update sample code for javax.swing.JComponent.update(java.awt.Graphics) definition code for javax.swing.JComponent.update(java.awt.Graphics)
 
Methods inherited from class java.awt.Container sample code for java.awt.Container definition code for java.awt.Container
add sample code for java.awt.Container.add(java.awt.Component) definition code for java.awt.Container.add(java.awt.Component) , add sample code for java.awt.Container.add(java.awt.Component, int) definition code for java.awt.Container.add(java.awt.Component, int) , add sample code for java.awt.Container.add(java.awt.Component, java.lang.Object) definition code for java.awt.Container.add(java.awt.Component, java.lang.Object) , add sample code for java.awt.Container.add(java.awt.Component, java.lang.Object, int) definition code for java.awt.Container.add(java.awt.Component, java.lang.Object, int) , add sample code for java.awt.Container.add(java.lang.String, java.awt.Component) definition code for java.awt.Container.add(java.lang.String, java.awt.Component) , addContainerListener sample code for java.awt.Container.addContainerListener(java.awt.event.ContainerListener) definition code for java.awt.Container.addContainerListener(java.awt.event.ContainerListener) , addImpl sample code for java.awt.Container.addImpl(java.awt.Component, java.lang.Object, int) definition code for java.awt.Container.addImpl(java.awt.Component, java.lang.Object, int) , addPropertyChangeListener sample code for java.awt.Container.addPropertyChangeListener(java.beans.PropertyChangeListener) definition code for java.awt.Container.addPropertyChangeListener(java.beans.PropertyChangeListener) , addPropertyChangeListener sample code for java.awt.Container.addPropertyChangeListener(java.lang.String, java.beans.PropertyChangeListener) definition code for java.awt.Container.addPropertyChangeListener(java.lang.String, java.beans.PropertyChangeListener) , applyComponentOrientation sample code for java.awt.Container.applyComponentOrientation(java.awt.ComponentOrientation) definition code for java.awt.Container.applyComponentOrientation(java.awt.ComponentOrientation) , areFocusTraversalKeysSet sample code for java.awt.Container.areFocusTraversalKeysSet(int) definition code for java.awt.Container.areFocusTraversalKeysSet(int) , countComponents sample code for java.awt.Container.countComponents() definition code for java.awt.Container.countComponents() , deliverEvent sample code for java.awt.Container.deliverEvent(java.awt.Event) definition code for java.awt.Container.deliverEvent(java.awt.Event) , doLayout sample code for java.awt.Container.doLayout() definition code for java.awt.Container.doLayout() , findComponentAt sample code for java.awt.Container.findComponentAt(int, int) definition code for java.awt.Container.findComponentAt(int, int) , findComponentAt sample code for java.awt.Container.findComponentAt(java.awt.Point) definition code for java.awt.Container.findComponentAt(java.awt.Point) , getComponent sample code for java.awt.Container.getComponent(int) definition code for java.awt.Container.getComponent(int) , getComponentAt sample code for java.awt.Container.getComponentAt(int, int) definition code for java.awt.Container.getComponentAt(int, int) , getComponentAt sample code for java.awt.Container.getComponentAt(java.awt.Point) definition code for java.awt.Container.getComponentAt(java.awt.Point) , getComponentCount sample code for java.awt.Container.getComponentCount() definition code for java.awt.Container.getComponentCount() , getComponents sample code for java.awt.Container.getComponents() definition code for java.awt.Container.getComponents() , getComponentZOrder sample code for java.awt.Container.getComponentZOrder(java.awt.Component) definition code for java.awt.Container.getComponentZOrder(java.awt.Component) , getContainerListeners sample code for java.awt.Container.getContainerListeners() definition code for java.awt.Container.getContainerListeners() , getFocusTraversalKeys sample code for java.awt.Container.getFocusTraversalKeys(int) definition code for java.awt.Container.getFocusTraversalKeys(int) , getFocusTraversalPolicy sample code for java.awt.Container.getFocusTraversalPolicy() definition code for java.awt.Container.getFocusTraversalPolicy() , getLayout sample code for java.awt.Container.getLayout() definition code for java.awt.Container.getLayout() , getMousePosition sample code for java.awt.Container.getMousePosition(boolean) definition code for java.awt.Container.getMousePosition(boolean) , insets sample code for java.awt.Container.insets() definition code for java.awt.Container.insets() , invalidate sample code for java.awt.Container.invalidate() definition code for java.awt.Container.invalidate() , isAncestorOf sample code for java.awt.Container.isAncestorOf(java.awt.Component) definition code for java.awt.Container.isAncestorOf(java.awt.Component) , isFocusCycleRoot sample code for java.awt.Container.isFocusCycleRoot() definition code for java.awt.Container.isFocusCycleRoot() , isFocusCycleRoot sample code for java.awt.Container.isFocusCycleRoot(java.awt.Container) definition code for java.awt.Container.isFocusCycleRoot(java.awt.Container) , isFocusTraversalPolicyProvider sample code for java.awt.Container.isFocusTraversalPolicyProvider() definition code for java.awt.Container.isFocusTraversalPolicyProvider() , isFocusTraversalPolicySet sample code for java.awt.Container.isFocusTraversalPolicySet() definition code for java.awt.Container.isFocusTraversalPolicySet() , layout sample code for java.awt.Container.layout() definition code for java.awt.Container.layout() , list sample code for java.awt.Container.list(java.io.PrintStream, int) definition code for java.awt.Container.list(java.io.PrintStream, int) , list sample code for java.awt.Container.list(java.io.PrintWriter, int) definition code for java.awt.Container.list(java.io.PrintWriter, int) , locate sample code for java.awt.Container.locate(int, int) definition code for java.awt.Container.locate(int, int) , minimumSize sample code for java.awt.Container.minimumSize() definition code for java.awt.Container.minimumSize() , paintComponents sample code for java.awt.Container.paintComponents(java.awt.Graphics) definition code for java.awt.Container.paintComponents(java.awt.Graphics) , preferredSize sample code for java.awt.Container.preferredSize() definition code for java.awt.Container.preferredSize() , printComponents sample code for java.awt.Container.printComponents(java.awt.Graphics) definition code for java.awt.Container.printComponents(java.awt.Graphics) , processContainerEvent sample code for java.awt.Container.processContainerEvent(java.awt.event.ContainerEvent) definition code for java.awt.Container.processContainerEvent(java.awt.event.ContainerEvent) , processEvent sample code for java.awt.Container.processEvent(java.awt.AWTEvent) definition code for java.awt.Container.processEvent(java.awt.AWTEvent) , remove sample code for java.awt.Container.remove(java.awt.Component) definition code for java.awt.Container.remove(java.awt.Component) , remove sample code for java.awt.Container.remove(int) definition code for java.awt.Container.remove(int) , removeAll sample code for java.awt.Container.removeAll() definition code for java.awt.Container.removeAll() , removeContainerListener sample code for java.awt.Container.removeContainerListener(java.awt.event.ContainerListener) definition code for java.awt.Container.removeContainerListener(java.awt.event.ContainerListener) , setComponentZOrder sample code for java.awt.Container.setComponentZOrder(java.awt.Component, int) definition code for java.awt.Container.setComponentZOrder(java.awt.Component, int) , setFocusCycleRoot sample code for java.awt.Container.setFocusCycleRoot(boolean) definition code for java.awt.Container.setFocusCycleRoot(boolean) , setFocusTraversalPolicy sample code for java.awt.Container.setFocusTraversalPolicy(java.awt.FocusTraversalPolicy) definition code for java.awt.Container.setFocusTraversalPolicy(java.awt.FocusTraversalPolicy) , setFocusTraversalPolicyProvider sample code for java.awt.Container.setFocusTraversalPolicyProvider(boolean) definition code for java.awt.Container.setFocusTraversalPolicyProvider(boolean) , setLayout sample code for java.awt.Container.setLayout(java.awt.LayoutManager) definition code for java.awt.Container.setLayout(java.awt.LayoutManager) , transferFocusBackward sample code for java.awt.Container.transferFocusBackward() definition code for java.awt.Container.transferFocusBackward() , transferFocusDownCycle sample code for java.awt.Container.transferFocusDownCycle() definition code for java.awt.Container.transferFocusDownCycle() , validate sample code for java.awt.Container.validate() definition code for java.awt.Container.validate() , validateTree sample code for java.awt.Container.validateTree() definition code for java.awt.Container.validateTree()
 
Methods inherited from class java.awt.Component sample code for java.awt.Component definition code for java.awt.Component
action sample code for java.awt.Component.action(java.awt.Event, java.lang.Object) definition code for java.awt.Component.action(java.awt.Event, java.lang.Object) , add sample code for java.awt.Component.add(java.awt.PopupMenu) definition code for java.awt.Component.add(java.awt.PopupMenu) , addComponentListener sample code for java.awt.Component.addComponentListener(java.awt.event.ComponentListener) definition code for java.awt.Component.addComponentListener(java.awt.event.ComponentListener) , addFocusListener sample code for java.awt.Component.addFocusListener(java.awt.event.FocusListener) definition code for java.awt.Component.addFocusListener(java.awt.event.FocusListener) , addHierarchyBoundsListener sample code for java.awt.Component.addHierarchyBoundsListener(java.awt.event.HierarchyBoundsListener) definition code for java.awt.Component.addHierarchyBoundsListener(java.awt.event.HierarchyBoundsListener) , addHierarchyListener sample code for java.awt.Component.addHierarchyListener(java.awt.event.HierarchyListener) definition code for java.awt.Component.addHierarchyListener(java.awt.event.HierarchyListener) , addInputMethodListener sample code for java.awt.Component.addInputMethodListener(java.awt.event.InputMethodListener) definition code for java.awt.Component.addInputMethodListener(java.awt.event.InputMethodListener) , addKeyListener sample code for java.awt.Component.addKeyListener(java.awt.event.KeyListener) definition code for java.awt.Component.addKeyListener(java.awt.event.KeyListener) , addMouseListener sample code for java.awt.Component.addMouseListener(java.awt.event.MouseListener) definition code for java.awt.Component.addMouseListener(java.awt.event.MouseListener) , addMouseMotionListener sample code for java.awt.Component.addMouseMotionListener(java.awt.event.MouseMotionListener) definition code for java.awt.Component.addMouseMotionListener(java.awt.event.MouseMotionListener) , addMouseWheelListener sample code for java.awt.Component.addMouseWheelListener(java.awt.event.MouseWheelListener) definition code for java.awt.Component.addMouseWheelListener(java.awt.event.MouseWheelListener) , bounds sample code for java.awt.Component.bounds() definition code for java.awt.Component.bounds() , checkImage sample code for java.awt.Component.checkImage(java.awt.Image, java.awt.image.ImageObserver) definition code for java.awt.Component.checkImage(java.awt.Image, java.awt.image.ImageObserver) , checkImage sample code for java.awt.Component.checkImage(java.awt.Image, int, int, java.awt.image.ImageObserver) definition code for java.awt.Component.checkImage(java.awt.Image, int, int, java.awt.image.ImageObserver) , coalesceEvents sample code for java.awt.Component.coalesceEvents(java.awt.AWTEvent, java.awt.AWTEvent) definition code for java.awt.Component.coalesceEvents(java.awt.AWTEvent, java.awt.AWTEvent) , contains sample code for java.awt.Component.contains(java.awt.Point) definition code for java.awt.Component.contains(java.awt.Point) , createImage sample code for java.awt.Component.createImage(java.awt.image.ImageProducer) definition code for java.awt.Component.createImage(java.awt.image.ImageProducer) , createImage sample code for java.awt.Component.createImage(int, int) definition code for java.awt.Component.createImage(int, int) , createVolatileImage sample code for java.awt.Component.createVolatileImage(int, int) definition code for java.awt.Component.createVolatileImage(int, int) , createVolatileImage sample code for java.awt.Component.createVolatileImage(int, int, java.awt.ImageCapabilities) definition code for java.awt.Component.createVolatileImage(int, int, java.awt.ImageCapabilities) , disableEvents sample code for java.awt.Component.disableEvents(long) definition code for java.awt.Component.disableEvents(long) , dispatchEvent sample code for java.awt.Component.dispatchEvent(java.awt.AWTEvent) definition code for java.awt.Component.dispatchEvent(java.awt.AWTEvent) , enable sample code for java.awt.Component.enable(boolean) definition code for java.awt.Component.enable(boolean) , enableEvents sample code for java.awt.Component.enableEvents(long) definition code for java.awt.Component.enableEvents(long) , enableInputMethods sample code for java.awt.Component.enableInputMethods(boolean) definition code for java.awt.Component.enableInputMethods(boolean) , firePropertyChange sample code for java.awt.Component.firePropertyChange(java.lang.String, byte, byte) definition code for java.awt.Component.firePropertyChange(java.lang.String, byte, byte) , firePropertyChange sample code for java.awt.Component.firePropertyChange(java.lang.String, double, double) definition code for java.awt.Component.firePropertyChange(java.lang.String, double, double) , firePropertyChange sample code for java.awt.Component.firePropertyChange(java.lang.String, float, float) definition code for java.awt.Component.firePropertyChange(java.lang.String, float, float) , firePropertyChange sample code for java.awt.Component.firePropertyChange(java.lang.String, long, long) definition code for java.awt.Component.firePropertyChange(java.lang.String, long, long) , firePropertyChange sample code for java.awt.Component.firePropertyChange(java.lang.String, java.lang.Object, java.lang.Object) definition code for java.awt.Component.firePropertyChange(java.lang.String, java.lang.Object, java.lang.Object) , firePropertyChange sample code for java.awt.Component.firePropertyChange(java.lang.String, short, short) definition code for java.awt.Component.firePropertyChange(java.lang.String, short, short) , getBackground sample code for java.awt.Component.getBackground() definition code for java.awt.Component.getBackground() , getBounds sample code for java.awt.Component.getBounds() definition code for java.awt.Component.getBounds() , getColorModel sample code for java.awt.Component.getColorModel() definition code for java.awt.Component.getColorModel() , getComponentListeners sample code for java.awt.Component.getComponentListeners() definition code for java.awt.Component.getComponentListeners() , getComponentOrientation sample code for java.awt.Component.getComponentOrientation() definition code for java.awt.Component.getComponentOrientation() , getCursor sample code for java.awt.Component.getCursor() definition code for java.awt.Component.getCursor() , getDropTarget sample code for java.awt.Component.getDropTarget() definition code for java.awt.Component.getDropTarget() , getFocusCycleRootAncestor sample code for java.awt.Component.getFocusCycleRootAncestor() definition code for java.awt.Component.getFocusCycleRootAncestor() , getFocusListeners sample code for java.awt.Component.getFocusListeners() definition code for java.awt.Component.getFocusListeners() , getFocusTraversalKeysEnabled sample code for java.awt.Component.getFocusTraversalKeysEnabled() definition code for java.awt.Component.getFocusTraversalKeysEnabled() , getFont sample code for java.awt.Component.getFont() definition code for java.awt.Component.getFont() , getForeground sample code for java.awt.Component.getForeground() definition code for java.awt.Component.getForeground() , getGraphicsConfiguration sample code for java.awt.Component.getGraphicsConfiguration() definition code for java.awt.Component.getGraphicsConfiguration() , getHierarchyBoundsListeners sample code for java.awt.Component.getHierarchyBoundsListeners() definition code for java.awt.Component.getHierarchyBoundsListeners() , getHierarchyListeners sample code for java.awt.Component.getHierarchyListeners() definition code for java.awt.Component.getHierarchyListeners() , getIgnoreRepaint sample code for java.awt.Component.getIgnoreRepaint() definition code for java.awt.Component.getIgnoreRepaint() , getInputContext sample code for java.awt.Component.getInputContext() definition code for java.awt.Component.getInputContext() , getInputMethodListeners sample code for java.awt.Component.getInputMethodListeners() definition code for java.awt.Component.getInputMethodListeners() , getInputMethodRequests sample code for java.awt.Component.getInputMethodRequests() definition code for java.awt.Component.getInputMethodRequests() , getKeyListeners sample code for java.awt.Component.getKeyListeners() definition code for java.awt.Component.getKeyListeners() , getLocale sample code for java.awt.Component.getLocale() definition code for java.awt.Component.getLocale() , getLocation sample code for java.awt.Component.getLocation() definition code for java.awt.Component.getLocation() , getLocationOnScreen sample code for java.awt.Component.getLocationOnScreen() definition code for java.awt.Component.getLocationOnScreen() , getMouseListeners sample code for java.awt.Component.getMouseListeners() definition code for java.awt.Component.getMouseListeners() , getMouseMotionListeners sample code for java.awt.Component.getMouseMotionListeners() definition code for java.awt.Component.getMouseMotionListeners() , getMousePosition sample code for java.awt.Component.getMousePosition() definition code for java.awt.Component.getMousePosition() , getMouseWheelListeners sample code for java.awt.Component.getMouseWheelListeners() definition code for java.awt.Component.getMouseWheelListeners() , getName sample code for java.awt.Component.getName() definition code for java.awt.Component.getName() , getParent sample code for java.awt.Component.getParent() definition code for java.awt.Component.getParent() , getPeer sample code for java.awt.Component.getPeer() definition code for java.awt.Component.getPeer() , getPropertyChangeListeners sample code for java.awt.Component.getPropertyChangeListeners() definition code for java.awt.Component.getPropertyChangeListeners() , getPropertyChangeListeners sample code for java.awt.Component.getPropertyChangeListeners(java.lang.String) definition code for java.awt.Component.getPropertyChangeListeners(java.lang.String) , getSize sample code for java.awt.Component.getSize() definition code for java.awt.Component.getSize() , getToolkit sample code for java.awt.Component.getToolkit() definition code for java.awt.Component.getToolkit() , getTreeLock sample code for java.awt.Component.getTreeLock() definition code for java.awt.Component.getTreeLock() , gotFocus sample code for java.awt.Component.gotFocus(java.awt.Event, java.lang.Object) definition code for java.awt.Component.gotFocus(java.awt.Event, java.lang.Object) , handleEvent sample code for java.awt.Component.handleEvent(java.awt.Event) definition code for java.awt.Component.handleEvent(java.awt.Event) , hasFocus sample code for java.awt.Component.hasFocus() definition code for java.awt.Component.hasFocus() , hide sample code for java.awt.Component.hide() definition code for java.awt.Component.hide() , imageUpdate sample code for java.awt.Component.imageUpdate(java.awt.Image, int, int, int, int, int) definition code for java.awt.Component.imageUpdate(java.awt.Image, int, int, int, int, int) , inside sample code for java.awt.Component.inside(int, int) definition code for java.awt.Component.inside(int, int) , isBackgroundSet sample code for java.awt.Component.isBackgroundSet() definition code for java.awt.Component.isBackgroundSet() , isCursorSet sample code for java.awt.Component.isCursorSet() definition code for java.awt.Component.isCursorSet() , isDisplayable sample code for java.awt.Component.isDisplayable() definition code for java.awt.Component.isDisplayable() , isEnabled sample code for java.awt.Component.isEnabled() definition code for java.awt.Component.isEnabled() , isFocusable sample code for java.awt.Component.isFocusable() definition code for java.awt.Component.isFocusable() , isFocusOwner sample code for java.awt.Component.isFocusOwner() definition code for java.awt.Component.isFocusOwner() , isFocusTraversable sample code for java.awt.Component.isFocusTraversable() definition code for java.awt.Component.isFocusTraversable() , isFontSet sample code for java.awt.Component.isFontSet() definition code for java.awt.Component.isFontSet() , isForegroundSet sample code for java.awt.Component.isForegroundSet() definition code for java.awt.Component.isForegroundSet() , isLightweight sample code for java.awt.Component.isLightweight() definition code for java.awt.Component.isLightweight() , isMaximumSizeSet sample code for java.awt.Component.isMaximumSizeSet() definition code for java.awt.Component.isMaximumSizeSet() , isMinimumSizeSet sample code for java.awt.Component.isMinimumSizeSet() definition code for java.awt.Component.isMinimumSizeSet() , isPreferredSizeSet sample code for java.awt.Component.isPreferredSizeSet() definition code for java.awt.Component.isPreferredSizeSet() , isShowing sample code for java.awt.Component.isShowing() definition code for java.awt.Component.isShowing() , isValid sample code for java.awt.Component.isValid() definition code for java.awt.Component.isValid() , isVisible sample code for java.awt.Component.isVisible() definition code for java.awt.Component.isVisible() , keyDown sample code for java.awt.Component.keyDown(java.awt.Event, int) definition code for java.awt.Component.keyDown(java.awt.Event, int) , keyUp sample code for java.awt.Component.keyUp(java.awt.Event, int) definition code for java.awt.Component.keyUp(java.awt.Event, int) , list sample code for java.awt.Component.list() definition code for java.awt.Component.list() , list sample code for java.awt.Component.list(java.io.PrintStream) definition code for java.awt.Component.list(java.io.PrintStream) , list sample code for java.awt.Component.list(java.io.PrintWriter) definition code for java.awt.Component.list(java.io.PrintWriter) , location sample code for java.awt.Component.location() definition code for java.awt.Component.location() , lostFocus sample code for java.awt.Component.lostFocus(java.awt.Event, java.lang.Object) definition code for java.awt.Component.lostFocus(java.awt.Event, java.lang.Object) , mouseDown sample code for java.awt.Component.mouseDown(java.awt.Event, int, int) definition code for java.awt.Component.mouseDown(java.awt.Event, int, int) , mouseDrag sample code for java.awt.Component.mouseDrag(java.awt.Event, int, int) definition code for java.awt.Component.mouseDrag(java.awt.Event, int, int) , mouseEnter sample code for java.awt.Component.mouseEnter(java.awt.Event, int, int) definition code for java.awt.Component.mouseEnter(java.awt.Event, int, int) , mouseExit sample code for java.awt.Component.mouseExit(java.awt.Event, int, int) definition code for java.awt.Component.mouseExit(java.awt.Event, int, int) , mouseMove sample code for java.awt.Component.mouseMove(java.awt.Event, int, int) definition code for java.awt.Component.mouseMove(java.awt.Event, int, int) , mouseUp sample code for java.awt.Component.mouseUp(java.awt.Event, int, int) definition code for java.awt.Component.mouseUp(java.awt.Event, int, int) , move sample code for java.awt.Component.move(int, int) definition code for java.awt.Component.move(int, int) , nextFocus sample code for java.awt.Component.nextFocus() definition code for java.awt.Component.nextFocus() , paintAll sample code for java.awt.Component.paintAll(java.awt.Graphics) definition code for java.awt.Component.paintAll(java.awt.Graphics) , postEvent sample code for java.awt.Component.postEvent(java.awt.Event) definition code for java.awt.Component.postEvent(java.awt.Event) , prepareImage sample code for java.awt.Component.prepareImage(java.awt.Image, java.awt.image.ImageObserver) definition code for java.awt.Component.prepareImage(java.awt.Image, java.awt.image.ImageObserver) , prepareImage sample code for java.awt.Component.prepareImage(java.awt.Image, int, int, java.awt.image.ImageObserver) definition code for java.awt.Component.prepareImage(java.awt.Image, int, int, java.awt.image.ImageObserver) , processComponentEvent sample code for java.awt.Component.processComponentEvent(java.awt.event.ComponentEvent) definition code for java.awt.Component.processComponentEvent(java.awt.event.ComponentEvent) , processFocusEvent sample code for java.awt.Component.processFocusEvent(java.awt.event.FocusEvent) definition code for java.awt.Component.processFocusEvent(java.awt.event.FocusEvent) , processHierarchyBoundsEvent sample code for java.awt.Component.processHierarchyBoundsEvent(java.awt.event.HierarchyEvent) definition code for java.awt.Component.processHierarchyBoundsEvent(java.awt.event.HierarchyEvent) , processHierarchyEvent sample code for java.awt.Component.processHierarchyEvent(java.awt.event.HierarchyEvent) definition code for java.awt.Component.processHierarchyEvent(java.awt.event.HierarchyEvent) , processInputMethodEvent sample code for java.awt.Component.processInputMethodEvent(java.awt.event.InputMethodEvent) definition code for java.awt.Component.processInputMethodEvent(java.awt.event.InputMethodEvent) , processMouseWheelEvent sample code for java.awt.Component.processMouseWheelEvent(java.awt.event.MouseWheelEvent) definition code for java.awt.Component.processMouseWheelEvent(java.awt.event.MouseWheelEvent) , remove sample code for java.awt.Component.remove(java.awt.MenuComponent) definition code for java.awt.Component.remove(java.awt.MenuComponent) , removeComponentListener sample code for java.awt.Component.removeComponentListener(java.awt.event.ComponentListener) definition code for java.awt.Component.removeComponentListener(java.awt.event.ComponentListener) , removeFocusListener sample code for java.awt.Component.removeFocusListener(java.awt.event.FocusListener) definition code for java.awt.Component.removeFocusListener(java.awt.event.FocusListener) , removeHierarchyBoundsListener sample code for java.awt.Component.removeHierarchyBoundsListener(java.awt.event.HierarchyBoundsListener) definition code for java.awt.Component.removeHierarchyBoundsListener(java.awt.event.HierarchyBoundsListener) , removeHierarchyListener sample code for java.awt.Component.removeHierarchyListener(java.awt.event.HierarchyListener) definition code for java.awt.Component.removeHierarchyListener(java.awt.event.HierarchyListener) , removeInputMethodListener sample code for java.awt.Component.removeInputMethodListener(java.awt.event.InputMethodListener) definition code for java.awt.Component.removeInputMethodListener(java.awt.event.InputMethodListener) , removeKeyListener sample code for java.awt.Component.removeKeyListener(java.awt.event.KeyListener) definition code for java.awt.Component.removeKeyListener(java.awt.event.KeyListener) , removeMouseListener sample code for java.awt.Component.removeMouseListener(java.awt.event.MouseListener) definition code for java.awt.Component.removeMouseListener(java.awt.event.MouseListener) , removeMouseMotionListener sample code for java.awt.Component.removeMouseMotionListener(java.awt.event.MouseMotionListener) definition code for java.awt.Component.removeMouseMotionListener(java.awt.event.MouseMotionListener) , removeMouseWheelListener sample code for java.awt.Component.removeMouseWheelListener(java.awt.event.MouseWheelListener) definition code for java.awt.Component.removeMouseWheelListener(java.awt.event.MouseWheelListener) , removePropertyChangeListener sample code for java.awt.Component.removePropertyChangeListener(java.beans.PropertyChangeListener) definition code for java.awt.Component.removePropertyChangeListener(java.beans.PropertyChangeListener) , removePropertyChangeListener sample code for java.awt.Component.removePropertyChangeListener(java.lang.String, java.beans.PropertyChangeListener) definition code for java.awt.Component.removePropertyChangeListener(java.lang.String, java.beans.PropertyChangeListener) , repaint sample code for java.awt.Component.repaint() definition code for java.awt.Component.repaint() , repaint sample code for java.awt.Component.repaint(int, int, int, int) definition code for java.awt.Component.repaint(int, int, int, int) , repaint sample code for java.awt.Component.repaint(long) definition code for java.awt.Component.repaint(long) , resize sample code for java.awt.Component.resize(java.awt.Dimension) definition code for java.awt.Component.resize(java.awt.Dimension) , resize sample code for java.awt.Component.resize(int, int) definition code for java.awt.Component.resize(int, int) , setBounds sample code for java.awt.Component.setBounds(int, int, int, int) definition code for java.awt.Component.setBounds(int, int, int, int) , setBounds sample code for java.awt.Component.setBounds(java.awt.Rectangle) definition code for java.awt.Component.setBounds(java.awt.Rectangle) , setComponentOrientation sample code for java.awt.Component.setComponentOrientation(java.awt.ComponentOrientation) definition code for java.awt.Component.setComponentOrientation(java.awt.ComponentOrientation) , setCursor sample code for java.awt.Component.setCursor(java.awt.Cursor) definition code for java.awt.Component.setCursor(java.awt.Cursor) , setDropTarget sample code for java.awt.Component.setDropTarget(java.awt.dnd.DropTarget) definition code for java.awt.Component.setDropTarget(java.awt.dnd.DropTarget) , setFocusable sample code for java.awt.Component.setFocusable(boolean) definition code for java.awt.Component.setFocusable(boolean) , setFocusTraversalKeysEnabled sample code for java.awt.Component.setFocusTraversalKeysEnabled(boolean) definition code for java.awt.Component.setFocusTraversalKeysEnabled(boolean) , setIgnoreRepaint sample code for java.awt.Component.setIgnoreRepaint(boolean) definition code for java.awt.Component.setIgnoreRepaint(boolean) , setLocale sample code for java.awt.Component.setLocale(java.util.Locale) definition code for java.awt.Component.setLocale(java.util.Locale) , setLocation sample code for java.awt.Component.setLocation(int, int) definition code for java.awt.Component.setLocation(int, int) , setLocation sample code for java.awt.Component.setLocation(java.awt.Point) definition code for java.awt.Component.setLocation(java.awt.Point) , setName sample code for java.awt.Component.setName(java.lang.String) definition code for java.awt.Component.setName(java.lang.String) , setSize sample code for java.awt.Component.setSize(java.awt.Dimension) definition code for java.awt.Component.setSize(java.awt.Dimension) , setSize sample code for java.awt.Component.setSize(int, int) definition code for java.awt.Component.setSize(int, int) , show sample code for java.awt.Component.show() definition code for java.awt.Component.show() , show sample code for java.awt.Component.show(boolean) definition code for java.awt.Component.show(boolean) , size sample code for java.awt.Component.size() definition code for java.awt.Component.size() , toString sample code for java.awt.Component.toString() definition code for java.awt.Component.toString() , transferFocus sample code for java.awt.Component.transferFocus() definition code for java.awt.Component.transferFocus() , transferFocusUpCycle sample code for java.awt.Component.transferFocusUpCycle() definition code for java.awt.Component.transferFocusUpCycle()
 
Methods inherited from class java.lang.Object sample code for java.lang.Object definition code for java.lang.Object
clone sample code for java.lang.Object.clone() definition code for java.lang.Object.clone() , equals sample code for java.lang.Object.equals(java.lang.Object) definition code for java.lang.Object.equals(java.lang.Object) , finalize sample code for java.lang.Object.finalize() definition code for java.lang.Object.finalize() , getClass sample code for java.lang.Object.getClass() definition code for java.lang.Object.getClass() , hashCode sample code for java.lang.Object.hashCode() definition code for java.lang.Object.hashCode() , notify sample code for java.lang.Object.notify() definition code for java.lang.Object.notify() , notifyAll sample code for java.lang.Object.notifyAll() definition code for java.lang.Object.notifyAll() , wait sample code for java.lang.Object.wait() definition code for java.lang.Object.wait() , wait sample code for java.lang.Object.wait(long) definition code for java.lang.Object.wait(long) , wait sample code for java.lang.Object.wait(long, int) definition code for java.lang.Object.wait(long, int)
 

Field Detail

treeModel sample code for javax.swing.JTree.treeModel

protected transient TreeModel sample code for javax.swing.tree.TreeModel definition code for javax.swing.tree.TreeModel  treeModel
The model that defines the tree displayed by this object.


selectionModel sample code for javax.swing.JTree.selectionModel

protected transient TreeSelectionModel sample code for javax.swing.tree.TreeSelectionModel definition code for javax.swing.tree.TreeSelectionModel  selectionModel
Models the set of selected nodes in this tree.


rootVisible sample code for javax.swing.JTree.rootVisible

protected boolean rootVisible
True if the root node is displayed, false if its children are the highest visible nodes.


cellRenderer sample code for javax.swing.JTree.cellRenderer

protected transient TreeCellRenderer sample code for javax.swing.tree.TreeCellRenderer definition code for javax.swing.tree.TreeCellRenderer  cellRenderer
The cell used to draw nodes. If null, the UI uses a default cellRenderer.


rowHeight sample code for javax.swing.JTree.rowHeight

protected int rowHeight
Height to use for each display row. If this is <= 0 the renderer determines the height for each row.


showsRootHandles sample code for javax.swing.JTree.showsRootHandles

protected boolean showsRootHandles
True if handles are displayed at the topmost level of the tree.

A handle is a small icon that displays adjacent to the node which allows the user to click once to expand or collapse the node. A common interface shows a plus sign (+) for a node which can be expanded and a minus sign (-) for a node which can be collapsed. Handles are always shown for nodes below the topmost level.

If the rootVisible setting specifies that the root node is to be displayed, then that is the only node at the topmost level. If the root node is not displayed, then all of its children are at the topmost level of the tree. Handles are always displayed for nodes other than the topmost.

If the root node isn't visible, it is generally a good to make this value true. Otherwise, the tree looks exactly like a list, and users may not know that the "list entries" are actually tree nodes.

See Also:
rootVisible sample code for javax.swing.JTree.rootVisible definition code for javax.swing.JTree.rootVisible

selectionRedirector sample code for javax.swing.JTree.selectionRedirector

protected transient JTree.TreeSelectionRedirector sample code for javax.swing.JTree.TreeSelectionRedirector definition code for javax.swing.JTree.TreeSelectionRedirector  selectionRedirector
Creates a new event and passed it off the selectionListeners.


cellEditor sample code for javax.swing.JTree.cellEditor

protected transient TreeCellEditor sample code for javax.swing.tree.TreeCellEditor definition code for javax.swing.tree.TreeCellEditor  cellEditor
Editor for the entries. Default is null (tree is not editable).


editable sample code for javax.swing.JTree.editable

protected boolean editable
Is the tree editable? Default is false.


largeModel sample code for javax.swing.JTree.largeModel

protected boolean largeModel
Is this tree a large model? This is a code-optimization setting. A large model can be used when the cell height is the same for all nodes. The UI will then cache very little information and instead continually message the model. Without a large model the UI caches most of the information, resulting in fewer method calls to the model.

This value is only a suggestion to the UI. Not all UIs will take advantage of it. Default value is false.


visibleRowCount sample code for javax.swing.JTree.visibleRowCount

protected int visibleRowCount
Number of rows to make visible at one time. This value is used for the Scrollable interface. It determines the preferred size of the display area.


invokesStopCellEditing sample code for javax.swing.JTree.invokesStopCellEditing

protected boolean 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. If false, cancelCellEditing is invoked, and changes are discarded. Default is false.


scrollsOnExpand sample code for javax.swing.JTree.scrollsOnExpand

protected boolean scrollsOnExpand
If true, when a node is expanded, as many of the descendants are scrolled to be visible.


toggleClickCount sample code for javax.swing.JTree.toggleClickCount

protected int toggleClickCount
Number of mouse clicks before a node is expanded.


treeModelListener sample code for javax.swing.JTree.treeModelListener

protected transient TreeModelListener sample code for javax.swing.event.TreeModelListener definition code for javax.swing.event.TreeModelListener  treeModelListener
Updates the expandedState.


CELL_RENDERER_PROPERTY sample code for javax.swing.JTree.CELL_RENDERER_PROPERTY

public static final String sample code for java.lang.String definition code for java.lang.String  CELL_RENDERER_PROPERTY
Bound property name for cellRenderer.

See Also:
Constant Field Values

TREE_MODEL_PROPERTY sample code for javax.swing.JTree.TREE_MODEL_PROPERTY

public static final String sample code for java.lang.String definition code for java.lang.String  TREE_MODEL_PROPERTY
Bound property name for treeModel.

See Also:
Constant Field Values

ROOT_VISIBLE_PROPERTY sample code for javax.swing.JTree.ROOT_VISIBLE_PROPERTY

public static final String sample code for java.lang.String definition code for java.lang.String  ROOT_VISIBLE_PROPERTY
Bound property name for rootVisible.

See Also:
Constant Field Values

SHOWS_ROOT_HANDLES_PROPERTY sample code for javax.swing.JTree.SHOWS_ROOT_HANDLES_PROPERTY

public static final String sample code for java.lang.String definition code for java.lang.String  SHOWS_ROOT_HANDLES_PROPERTY
Bound property name for showsRootHandles.

See Also:
Constant Field Values

ROW_HEIGHT_PROPERTY sample code for javax.swing.JTree.ROW_HEIGHT_PROPERTY

public static final String sample code for java.lang.String definition code for java.lang.String  ROW_HEIGHT_PROPERTY
Bound property name for rowHeight.

See Also:
Constant Field Values

CELL_EDITOR_PROPERTY sample code for javax.swing.JTree.CELL_EDITOR_PROPERTY

public static final String sample code for java.lang.String definition code for java.lang.String  CELL_EDITOR_PROPERTY
Bound property name for cellEditor.

See Also:
Constant Field Values

EDITABLE_PROPERTY sample code for javax.swing.JTree.EDITABLE_PROPERTY

public static final String sample code for java.lang.String definition code for java.lang.String  EDITABLE_PROPERTY
Bound property name for editable.

See Also:
Constant Field Values

LARGE_MODEL_PROPERTY sample code for javax.swing.JTree.LARGE_MODEL_PROPERTY

public static final String sample code for java.lang.String definition code for java.lang.String  LARGE_MODEL_PROPERTY
Bound property name for largeModel.

See Also:
Constant Field Values

SELECTION_MODEL_PROPERTY sample code for javax.swing.JTree.SELECTION_MODEL_PROPERTY

public static final String sample code for java.lang.String definition code for java.lang.String  SELECTION_MODEL_PROPERTY
Bound property name for selectionModel.

See Also:
Constant Field Values

VISIBLE_ROW_COUNT_PROPERTY sample code for javax.swing.JTree.VISIBLE_ROW_COUNT_PROPERTY

public static final String sample code for java.lang.String definition code for java.lang.String  VISIBLE_ROW_COUNT_PROPERTY
Bound property name for visibleRowCount.

See Also:
Constant Field Values

INVOKES_STOP_CELL_EDITING_PROPERTY sample code for javax.swing.JTree.INVOKES_STOP_CELL_EDITING_PROPERTY

public static final String sample code for java.lang.String definition code for java.lang.String  INVOKES_STOP_CELL_EDITING_PROPERTY
Bound property name for messagesStopCellEditing.

See Also:
Constant Field Values

SCROLLS_ON_EXPAND_PROPERTY sample code for javax.swing.JTree.SCROLLS_ON_EXPAND_PROPERTY

public static final String sample code for java.lang.String definition code for java.lang.String  SCROLLS_ON_EXPAND_PROPERTY
Bound property name for scrollsOnExpand.

See Also:
Constant Field Values

TOGGLE_CLICK_COUNT_PROPERTY sample code for javax.swing.JTree.TOGGLE_CLICK_COUNT_PROPERTY

public static final String sample code for java.lang.String definition code for java.lang.String  TOGGLE_CLICK_COUNT_PROPERTY
Bound property name for toggleClickCount.

See Also:
Constant Field Values

LEAD_SELECTION_PATH_PROPERTY sample code for javax.swing.JTree.LEAD_SELECTION_PATH_PROPERTY

public static final String sample code for java.lang.String definition code for java.lang.String  LEAD_SELECTION_PATH_PROPERTY
Bound property name for leadSelectionPath.

Since:
1.3
See Also:
Constant Field Values

ANCHOR_SELECTION_PATH_PROPERTY sample code for javax.swing.JTree.ANCHOR_SELECTION_PATH_PROPERTY

public static final String sample code for java.lang.String definition code for java.lang.String  ANCHOR_SELECTION_PATH_PROPERTY
Bound property name for anchor selection path.

Since:
1.3
See Also:
Constant Field Values

EXPANDS_SELECTED_PATHS_PROPERTY sample code for javax.swing.JTree.EXPANDS_SELECTED_PATHS_PROPERTY

public static final String sample code for java.lang.String definition code for java.lang.String  EXPANDS_SELECTED_PATHS_PROPERTY
Bound property name for expands selected paths property

Since:
1.3
See Also:
Constant Field Values
Constructor Detail

JTree sample code for javax.swing.JTree() definition code for javax.swing.JTree()

public JTree()
Returns a JTree with a sample model. The default model used by the tree defines a leaf node as any node without children.

See Also:
DefaultTreeModel.asksAllowsChildren sample code for javax.swing.tree.DefaultTreeModel.asksAllowsChildren definition code for javax.swing.tree.DefaultTreeModel.asksAllowsChildren

JTree sample code for javax.swing.JTree(java.lang.Object[]) definition code for javax.swing.JTree(java.lang.Object[])

public JTree(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. By default, the tree defines a leaf node as any node without children.

Parameters:
value - an array of Objects
See Also:
DefaultTreeModel.asksAllowsChildren sample code for javax.swing.tree.DefaultTreeModel.asksAllowsChildren definition code for javax.swing.tree.DefaultTreeModel.asksAllowsChildren

JTree sample code for javax.swing.JTree(java.util.Vector<?>) definition code for javax.swing.JTree(java.util.Vector<?>)

public JTree(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. By default, the tree defines a leaf node as any node without children.

Parameters:
value - a Vector
See Also:
DefaultTreeModel.asksAllowsChildren sample code for javax.swing.tree.DefaultTreeModel.asksAllowsChildren definition code for javax.swing.tree.DefaultTreeModel.asksAllowsChildren

JTree sample code for javax.swing.JTree(java.util.Hashtable<?, ?>) definition code for javax.swing.JTree(java.util.Hashtable<?, ?>)

public JTree(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. Each value-half of the key/value pairs in the HashTable becomes a child of the new root node. By default, the tree defines a leaf node as any node without children.

Parameters:
value - a Hashtable
See Also:
DefaultTreeModel.asksAllowsChildren sample code for javax.swing.tree.DefaultTreeModel.asksAllowsChildren definition code for javax.swing.tree.DefaultTreeModel.asksAllowsChildren

JTree sample code for javax.swing.JTree(javax.swing.tree.TreeNode) definition code for javax.swing.JTree(javax.swing.tree.TreeNode)

public JTree(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. By default, the tree defines a leaf node as any node without children.

Parameters:
root - a TreeNode object
See Also:
DefaultTreeModel.asksAllowsChildren sample code for javax.swing.tree.DefaultTreeModel.asksAllowsChildren definition code for javax.swing.tree.DefaultTreeModel.asksAllowsChildren

JTree sample code for javax.swing.JTree(javax.swing.tree.TreeNode, boolean) definition code for javax.swing.JTree(javax.swing.tree.TreeNode, boolean)

public JTree(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.

Parameters:
root - a TreeNode object
asksAllowsChildren - if false, any node without children is a leaf node; if true, only nodes that do not allow children are leaf nodes
See Also:
DefaultTreeModel.asksAllowsChildren sample code for javax.swing.tree.DefaultTreeModel.asksAllowsChildren definition code for javax.swing.tree.DefaultTreeModel.asksAllowsChildren

JTree sample code for javax.swing.JTree(javax.swing.tree.TreeModel) definition code for javax.swing.JTree(javax.swing.tree.TreeModel)

public JTree(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.

Parameters:
newModel - the TreeModel to use as the data model
Method Detail

getDefaultTreeModel sample code for javax.swing.JTree.getDefaultTreeModel() definition code for javax.swing.JTree.getDefaultTreeModel()

protected static TreeModel sample code for javax.swing.tree.TreeModel definition code for javax.swing.tree.TreeModel  getDefaultTreeModel()
Creates and returns a sample TreeModel. Used primarily for beanbuilders to show something interesting.

Returns:
the default TreeModel

createTreeModel sample code for javax.swing.JTree.createTreeModel(java.lang.Object) definition code for javax.swing.JTree.createTreeModel(java.lang.Object)

protected static TreeModel sample code for javax.swing.tree.TreeModel definition code for javax.swing.tree.TreeModel  createTreeModel(Object sample code for java.lang.Object definition code for java.lang.Object  value)
Returns a TreeModel wrapping the specified object. If the object is:then a new root node is created with each of the incoming objects as children. Otherwise, a new root is created with the specified object as its value.

Parameters:
value - the Object used as the foundation for the TreeModel
Returns:
a TreeModel wrapping the specified object

getUI sample code for javax.swing.JTree.getUI() definition code for javax.swing.JTree.getUI()

public TreeUI sample code for javax.swing.plaf.TreeUI definition code for javax.swing.plaf.TreeUI  getUI()
Returns the L&F object that renders this component.

Returns:
the TreeUI object that renders this component

setUI sample code for javax.swing.JTree.setUI(javax.swing.plaf.TreeUI) definition code for javax.swing.JTree.setUI(javax.swing.plaf.TreeUI)

public void setUI(TreeUI sample code for javax.swing.plaf.TreeUI definition code for javax.swing.plaf.TreeUI  ui)
Sets the L&F object that renders this component.

Parameters:
ui - the TreeUI L&F object
See Also:
UIDefaults.getUI(javax.swing.JComponent) sample code for javax.swing.UIDefaults.getUI(javax.swing.JComponent) definition code for javax.swing.UIDefaults.getUI(javax.swing.JComponent)

updateUI sample code for javax.swing.JTree.updateUI() definition code for javax.swing.JTree.updateUI()

public void updateUI()
Notification from the UIManager that the L&F has changed. Replaces the current UI object with the latest version from the UIManager.

Overrides:
updateUI sample code for javax.swing.JComponent.updateUI() definition code for javax.swing.JComponent.updateUI() in class JComponent sample code for javax.swing.JComponent definition code for javax.swing.JComponent
See Also:
JComponent.updateUI() sample code for javax.swing.JComponent.updateUI() definition code for javax.swing.JComponent.updateUI()

getUIClassID sample code for javax.swing.JTree.getUIClassID() definition code for javax.swing.JTree.getUIClassID()

public String sample code for java.lang.String definition code for java.lang.String  getUIClassID()
Returns the name of the L&F class that renders this component.

Overrides:
getUIClassID sample code for javax.swing.JComponent.getUIClassID() definition code for javax.swing.JComponent.getUIClassID() in class JComponent sample code for javax.swing.JComponent definition code for javax.swing.JComponent
Returns:
the string "TreeUI"
See Also:
JComponent.getUIClassID() sample code for javax.swing.JComponent.getUIClassID() definition code for javax.swing.JComponent.getUIClassID() , UIDefaults.getUI(javax.swing.JComponent) sample code for javax.swing.UIDefaults.getUI(javax.swing.JComponent) definition code for javax.swing.UIDefaults.getUI(javax.swing.JComponent)

getCellRenderer sample code for javax.swing.JTree.getCellRenderer() definition code for javax.swing.JTree.getCellRenderer()

public TreeCellRenderer sample code for javax.swing.tree.TreeCellRenderer definition code for javax.swing.tree.TreeCellRenderer  getCellRenderer()
Returns the current TreeCellRenderer that is rendering each cell.

Returns:
the TreeCellRenderer that is rendering each cell

setCellRenderer sample code for javax.swing.JTree.setCellRenderer(javax.swing.tree.TreeCellRenderer) definition code for javax.swing.JTree.setCellRenderer(javax.swing.tree.TreeCellRenderer)

public void setCellRenderer(TreeCellRenderer sample code for javax.swing.tree.TreeCellRenderer definition code for javax.swing.tree.TreeCellRenderer  x)
Sets the TreeCellRenderer that will be used to draw each cell.

Parameters:
x - the TreeCellRenderer that is to render each cell

setEditable sample code for javax.swing.JTree.setEditable(boolean) definition code for javax.swing.JTree.setEditable(boolean)

public void setEditable(boolean flag)
Determines whether the tree is editable. Fires a property change event if the new setting is different from the existing setting.

Parameters:
flag - a boolean value, true if the tree is editable

isEditable sample code for javax.swing.JTree.isEditable() definition code for javax.swing.JTree.isEditable()

public boolean isEditable()
Returns true if the tree is editable.

Returns:
true if the tree is editable

setCellEditor sample code for javax.swing.JTree.setCellEditor(javax.swing.tree.TreeCellEditor) definition code for javax.swing.JTree.setCellEditor(javax.swing.tree.TreeCellEditor)

public void setCellEditor(TreeCellEditor sample code for javax.swing.tree.TreeCellEditor definition code for javax.swing.tree.TreeCellEditor  cellEditor)
Sets the cell editor. A null value implies that the tree cannot be edited. If this represents a change in the cellEditor, the propertyChange method is invoked on all listeners.

Parameters:
cellEditor - the TreeCellEditor to use

getCellEditor sample code for javax.swing.JTree.getCellEditor() definition code for javax.swing.JTree.getCellEditor()

public TreeCellEditor sample code for javax.swing.tree.TreeCellEditor definition code for javax.swing.tree.TreeCellEditor  getCellEditor()
Returns the editor used to edit entries in the tree.

Returns:
the TreeCellEditor in use, or null if the tree cannot be edited

getModel sample code for javax.swing.JTree.getModel() definition code for javax.swing.JTree.getModel()

public TreeModel sample code for javax.swing.tree.TreeModel definition code for javax.swing.tree.TreeModel  getModel()
Returns the TreeModel that is providing the data.

Returns:
the TreeModel that is providing the data

setModel sample code for javax.swing.JTree.setModel(javax.swing.tree.TreeModel) definition code for javax.swing.JTree.setModel(javax.swing.tree.TreeModel)

public void setModel(TreeModel sample code for javax.swing.tree.TreeModel definition code for javax.swing.tree.TreeModel  newModel)
Sets the TreeModel that will provide the data.

Parameters:
newModel - the TreeModel that is to provide the data

isRootVisible sample code for javax.swing.JTree.isRootVisible() definition code for javax.swing.JTree.isRootVisible()

public boolean isRootVisible()
Returns true if the root node of the tree is displayed.

Returns:
true if the root node of the tree is displayed
See Also:
rootVisible sample code for javax.swing.JTree.rootVisible definition code for javax.swing.JTree.rootVisible

setRootVisible sample code for javax.swing.JTree.setRootVisible(boolean) definition code for javax.swing.JTree.setRootVisible(boolean)

public void setRootVisible(boolean rootVisible)
Determines whether or not the root node from the TreeModel is visible.

Parameters:
rootVisible - true if the root node of the tree is to be displayed
See Also:
rootVisible sample code for javax.swing.JTree.rootVisible definition code for javax.swing.JTree.rootVisible

setShowsRootHandles sample code for javax.swing.JTree.setShowsRootHandles(boolean) definition code for javax.swing.JTree.setShowsRootHandles(boolean)

public void setShowsRootHandles(boolean newValue)
Sets the value of the showsRootHandles property, which specifies whether the node handles should be displayed. The default value of this property depends on the constructor used to create the JTree. Some look and feels might not support handles; they will ignore this property.

Parameters:
newValue - true if root handles should be displayed; otherwise, false
See Also:
showsRootHandles sample code for javax.swing.JTree.showsRootHandles definition code for javax.swing.JTree.showsRootHandles , getShowsRootHandles() sample code for javax.swing.JTree.getShowsRootHandles() definition code for javax.swing.JTree.getShowsRootHandles()

getShowsRootHandles sample code for javax.swing.JTree.getShowsRootHandles() definition code for javax.swing.JTree.getShowsRootHandles()

public boolean getShowsRootHandles()
Returns the value of the showsRootHandles property.

Returns:
the value of the showsRootHandles property
See Also:
showsRootHandles sample code for javax.swing.JTree.showsRootHandles definition code for javax.swing.JTree.showsRootHandles

setRowHeight sample code for javax.swing.JTree.setRowHeight(int) definition code for javax.swing.JTree.setRowHeight(int)

public void setRowHeight(int rowHeight)
Sets the height of each cell, in pixels. If the specified value is less than or equal to zero the current cell renderer is queried for each row's height.

Parameters:
rowHeight - the height of each cell, in pixels

getRowHeight sample code for javax.swing.JTree.getRowHeight() definition code for javax.swing.JTree.getRowHeight()

public int getRowHeight()
Returns the height of each row. If the returned value is less than or equal to 0 the height for each row is determined by the renderer.


isFixedRowHeight sample code for javax.swing.JTree.isFixedRowHeight() definition code for javax.swing.JTree.isFixedRowHeight()

public boolean isFixedRowHeight()
Returns true if the height of each display row is a fixed size.

Returns:
true if the height of each row is a fixed size

setLargeModel sample code for javax.swing.JTree.setLargeModel(boolean) definition code for javax.swing.JTree.setLargeModel(boolean)

public void setLargeModel(boolean newValue)
Specifies whether the UI should use a large model. (Not all UIs will implement this.) Fires a property change for the LARGE_MODEL_PROPERTY.

Parameters:
newValue - true to suggest a large model to the UI
See Also:
largeModel sample code for javax.swing.JTree.largeModel definition code for javax.swing.JTree.largeModel

isLargeModel sample code for javax.swing.JTree.isLargeModel() definition code for javax.swing.JTree.isLargeModel()

public boolean isLargeModel()
Returns true if the tree is configured for a large model.

Returns:
true if a large model is suggested
See Also:
largeModel sample code for javax.swing.JTree.largeModel definition code for javax.swing.JTree.largeModel

setInvokesStopCellEditing sample code for javax.swing.JTree.setInvokesStopCellEditing(boolean) definition code for javax.swing.JTree.setInvokesStopCellEditing(boolean)

public void setInvokesStopCellEditing(boolean newValue)
Determines what happens when editing is interrupted by selecting another node in the tree, a change in the tree's data, or by some other means. Setting this property to true causes the changes to be automatically saved when editing is interrupted.

Fires a property change for the INVOKES_STOP_CELL_EDITING_PROPERTY.

Parameters:
newValue - true means that stopCellEditing is invoked when editing is interrupted, and data is saved; false means that cancelCellEditing is invoked, and changes are lost

getInvokesStopCellEditing sample code for javax.swing.JTree.getInvokesStopCellEditing() definition code for javax.swing.JTree.getInvokesStopCellEditing()

public boolean getInvokesStopCellEditing()
Returns the indicator that tells what happens when editing is interrupted.

Returns:
the indicator that tells what happens when editing is interrupted
See Also:
setInvokesStopCellEditing(boolean) sample code for javax.swing.JTree.setInvokesStopCellEditing(boolean) definition code for javax.swing.JTree.setInvokesStopCellEditing(boolean)

setScrollsOnExpand sample code for javax.swing.JTree.setScrollsOnExpand(boolean) definition code for javax.swing.JTree.setScrollsOnExpand(boolean)

public void setScrollsOnExpand(boolean newValue)
Sets the scrollsOnExpand property, which determines whether the tree might scroll to show previously hidden children. If this property is true (the default), when a node expands the tree can use scrolling to make the maximum possible number of the node's descendants visible. In some look and feels, trees might not need to scroll when expanded; those look and feels will ignore this property.

Parameters:
newValue - false to disable scrolling on expansion; true to enable it
See Also:
getScrollsOnExpand() sample code for javax.swing.JTree.getScrollsOnExpand() definition code for javax.swing.JTree.getScrollsOnExpand()

getScrollsOnExpand sample code for javax.swing.JTree.getScrollsOnExpand() definition code for javax.swing.JTree.getScrollsOnExpand()

public boolean getScrollsOnExpand()
Returns the value of the scrollsOnExpand property.

Returns:
the value of the scrollsOnExpand property

setToggleClickCount sample code for javax.swing.JTree.setToggleClickCount(int) definition code for javax.swing.JTree.setToggleClickCount(int)

public void setToggleClickCount(int clickCount)
Sets the number of mouse clicks before a node will expand or close. The default is two.

Since:
1.3

getToggleClickCount sample code for javax.swing.JTree.getToggleClickCount() definition code for javax.swing.JTree.getToggleClickCount()

public int getToggleClickCount()
Returns the number of mouse clicks needed to expand or close a node.

Returns:
number of mouse clicks before node is expanded
Since:
1.3

setExpandsSelectedPaths sample code for javax.swing.JTree.setExpandsSelectedPaths(boolean) definition code for javax.swing.JTree.setExpandsSelectedPaths(boolean)

public void setExpandsSelectedPaths(boolean newValue)
Configures the expandsSelectedPaths property. If true, any time the selection is changed, either via the TreeSelectionModel, or the cover methods provided by JTree, the TreePaths parents will be expanded to make them visible (visible meaning the parent path is expanded, not necessarily in the visible rectangle of the JTree). If false, when the selection changes the nodes parent is not made visible (all its parents expanded). This is useful if you wish to have your selection model maintain paths that are not always visible (all parents expanded).

Parameters:
newValue - the new value for expandsSelectedPaths
Since:
1.3

getExpandsSelectedPaths sample code for javax.swing.JTree.getExpandsSelectedPaths() definition code for javax.swing.JTree.getExpandsSelectedPaths()

public boolean getExpandsSelectedPaths()
Returns the expandsSelectedPaths property.

Returns:
true if selection changes result in the parent path being expanded
Since:
1.3
See Also:
setExpandsSelectedPaths(boolean) sample code for javax.swing.JTree.setExpandsSelectedPaths(boolean) definition code for javax.swing.JTree.setExpandsSelectedPaths(boolean)

setDragEnabled sample code for javax.swing.JTree.setDragEnabled(boolean) definition code for javax.swing.JTree.setDragEnabled(boolean)

public void setDragEnabled(boolean b)
Sets the dragEnabled property, which must be true to enable automatic drag handling (the first part of drag and drop) on this component. The transferHandler property needs to be set to a non-null value for the drag to do anything. The default value of the dragEnabled property is false.

When automatic drag handling is enabled, most look and feels begin a drag-and-drop operation whenever the user presses the mouse button over a selection and then moves the mouse a few pixels. Setting this property to true can therefore have a subtle effect on how selections behave.

Some look and feels might not support automatic drag and drop; they will ignore this property. You can work around such look and feels by modifying the component to directly call the exportAsDrag method of a TransferHandler.

Parameters:
b - the value to set the dragEnabled property to
Throws:
HeadlessException sample code for java.awt.HeadlessException definition code for java.awt.HeadlessException - if b is true and GraphicsEnvironment.isHeadless() returns true
Since:
1.4
See Also:
GraphicsEnvironment.isHeadless() sample code for java.awt.GraphicsEnvironment.isHeadless() definition code for java.awt.GraphicsEnvironment.isHeadless() , getDragEnabled() sample code for javax.swing.JTree.getDragEnabled() definition code for javax.swing.JTree.getDragEnabled() , JComponent.setTransferHandler(javax.swing.TransferHandler) sample code for javax.swing.JComponent.setTransferHandler(javax.swing.TransferHandler) definition code for javax.swing.JComponent.setTransferHandler(javax.swing.TransferHandler) , TransferHandler sample code for javax.swing.TransferHandler definition code for javax.swing.TransferHandler

getDragEnabled sample code for javax.swing.JTree.getDragEnabled() definition code for javax.swing.JTree.getDragEnabled()

public boolean getDragEnabled()
Gets the value of the dragEnabled property.

Returns:
the value of the dragEnabled property
Since:
1.4
See Also:
setDragEnabled(boolean) sample code for javax.swing.JTree.setDragEnabled(boolean) definition code for javax.swing.JTree.setDragEnabled(boolean)

isPathEditable sample code for javax.swing.JTree.isPathEditable(javax.swing.tree.TreePath) definition code for javax.swing.JTree.isPathEditable(javax.swing.tree.TreePath)

public boolean isPathEditable(TreePath sample code for javax.swing.tree.TreePath definition code for javax.swing.tree.TreePath  path)
Returns isEditable. This is invoked from the UI before editing begins to insure that the given path can be edited. This is provided as an entry point for subclassers to add filtered editing without having to resort to creating a new editor.

Returns:
true if every parent node and the node itself is editable
See Also:
isEditable() sample code for javax.swing.JTree.isEditable() definition code for javax.swing.JTree.isEditable()

getToolTipText sample code for javax.swing.JTree.getToolTipText(java.awt.event.MouseEvent) definition code for javax.swing.JTree.getToolTipText(java.awt.event.MouseEvent)

public String sample code for java.lang.String definition code for java.lang.String  getToolTipText(MouseEvent sample code for java.awt.event.MouseEvent definition code for java.awt.event.MouseEvent  event)
Overrides JComponent's getToolTipText method in order to allow renderer's tips to be used if it has text set.

NOTE: For JTree to properly display tooltips of its renderers, JTree must be a registered component with the ToolTipManager. This can be done by invoking ToolTipManager.sharedInstance().registerComponent(tree). This is not done automatically!

Overrides:
getToolTipText sample code for javax.swing.JComponent.getToolTipText(java.awt.event.MouseEvent) definition code for javax.swing.JComponent.getToolTipText(java.awt.event.MouseEvent) in class JComponent sample code for javax.swing.JComponent definition code for javax.swing.JComponent
Parameters:
event - the MouseEvent that initiated the ToolTip display
Returns:
a string containing the tooltip or null if event is null

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)

public String sample code for java.lang.String definition code for java.lang.String  convertValueToText(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. This implementation returns value.toString, ignoring all other arguments. To control the conversion, subclass this method and use any of the arguments you need.

Parameters:
value - the Object to convert to text
selected - true if the node is selected
expanded - true if the node is expanded
leaf - true if the node is a leaf node
row - an integer specifying the node's display row, where 0 is the first row in the display
hasFocus - true if the node has the focus
Returns:
the String representation of the node's value

getRowCount sample code for javax.swing.JTree.getRowCount() definition code for javax.swing.JTree.getRowCount()

public int getRowCount()
Returns the number of rows that are currently being displayed.

Returns:
the number of rows that are being displayed

setSelectionPath sample code for javax.swing.JTree.setSelectionPath(javax.swing.tree.TreePath) definition code for javax.swing.JTree.setSelectionPath(javax.swing.tree.TreePath)

public void setSelectionPath(TreePath sample code for javax.swing.tree.TreePath definition code for javax.swing.tree.TreePath  path)
Selects the node identified by the specified path. If any component of the path is hidden (under a collapsed node), and getExpandsSelectedPaths is true it is exposed (made viewable).

Parameters:
path - the TreePath specifying the node to select

setSelectionPaths sample code for javax.swing.JTree.setSelectionPaths(javax.swing.tree.TreePath[]) definition code for javax.swing.JTree.setSelectionPaths(javax.swing.tree.TreePath[])

public void setSelectionPaths(TreePath sample code for javax.swing.tree.TreePath definition code for javax.swing.tree.TreePath [] paths)
Selects the nodes identified by the specified array of paths. If any component in any of the paths is hidden (under a collapsed node), and getExpandsSelectedPaths is true it is exposed (made viewable).

Parameters:
paths - an array of TreePath objects that specifies the nodes to select

setLeadSelectionPath sample code for javax.swing.JTree.setLeadSelectionPath(javax.swing.tree.TreePath) definition code for javax.swing.JTree.setLeadSelectionPath(javax.swing.tree.TreePath)

public void setLeadSelectionPath(TreePath sample code for javax.swing.tree.TreePath definition code for javax.swing.tree.TreePath  newPath)
Sets the path identifies as the lead. The lead may not be selected. The lead is not maintained by JTree, rather the UI will update it.

Parameters:
newPath - the new lead path
Since:
1.3

setAnchorSelectionPath sample code for javax.swing.JTree.setAnchorSelectionPath(javax.swing.tree.TreePath) definition code for javax.swing.JTree.setAnchorSelectionPath(javax.swing.tree.TreePath)

public void setAnchorSelectionPath(TreePath sample code for javax.swing.tree.TreePath definition code for javax.swing.tree.TreePath  newPath)
Sets the path identified as the anchor. The anchor is not maintained by JTree, rather the UI will update it.

Parameters:
newPath - the new anchor path
Since:
1.3

setSelectionRow sample code for javax.swing.JTree.setSelectionRow(int) definition code for javax.swing.JTree.setSelectionRow(int)

public void setSelectionRow(int row)
Selects the node at the specified row in the display.

Parameters:
row - the row to select, where 0 is the first row in the display

setSelectionRows sample code for javax.swing.JTree.setSelectionRows(int[]) definition code for javax.swing.JTree.setSelectionRows(int[])

public void setSelectionRows(int[] rows)
Selects the nodes corresponding to each of the specified rows in the display. If a particular element of rows is < 0 or >= getRowCount, it will be ignored. If none of the elements in rows are valid rows, the selection will be cleared. That is it will be as if clearSelection was invoked.

Parameters:
rows - an array of ints specifying the rows to select, where 0 indicates the first row in the display

addSelectionPath sample code for javax.swing.JTree.addSelectionPath(javax.swing.tree.TreePath) definition code for javax.swing.JTree.addSelectionPath(javax.swing.tree.TreePath)

public void addSelectionPath(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. If any component of the path isn't viewable, and getExpandsSelectedPaths is true it is made viewable.

Note that JTree does not allow duplicate nodes to exist as children under the same parent -- each sibling must be a unique object.

Parameters:
path - the TreePath to add

addSelectionPaths sample code for javax.swing.JTree.addSelectionPaths(javax.swing.tree.TreePath[]) definition code for javax.swing.JTree.addSelectionPaths(javax.swing.tree.TreePath[])

public void addSelectionPaths(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. If any component of any of the paths isn't viewable and getExpandsSelectedPaths is true, it is made viewable.

Note that JTree does not allow duplicate nodes to exist as children under the same parent -- each sibling must be a unique object.

Parameters:
paths - an array of TreePath objects that specifies the nodes to add

addSelectionRow sample code for javax.swing.JTree.addSelectionRow(int) definition code for javax.swing.JTree.addSelectionRow(int)

public void addSelectionRow(int row)
Adds the path at the specified row to the current selection.

Parameters:
row - an integer specifying the row of the node to add, where 0 is the first row in the display

addSelectionRows sample code for javax.swing.JTree.addSelectionRows(int[]) definition code for javax.swing.JTree.addSelectionRows(int[])

public void addSelectionRows(int[] rows)
Adds the paths at each of the specified rows to the current selection.

Parameters:
rows - an array of ints specifying the rows to add, where 0 indicates the first row in the display

getLastSelectedPathComponent sample code for javax.swing.JTree.getLastSelectedPathComponent() definition code for javax.swing.JTree.getLastSelectedPathComponent()

public Object sample code for java.lang.Object definition code for java.lang.Object  getLastSelectedPathComponent()
Returns the last path component in the first node of the current selection.

Returns:
the last Object in the first selected node's TreePath, or null if nothing is selected
See Also:
TreePath.getLastPathComponent() sample code for javax.swing.tree.TreePath.getLastPathComponent() definition code for javax.swing.tree.TreePath.getLastPathComponent()

getLeadSelectionPath sample code for javax.swing.JTree.getLeadSelectionPath() definition code for javax.swing.JTree.getLeadSelectionPath()

public TreePath sample code for javax.swing.tree.TreePath definition code for javax.swing.tree.TreePath  getLeadSelectionPath()
Returns the path identified as the lead.

Returns:
path identified as the lead

getAnchorSelectionPath sample code for javax.swing.JTree.getAnchorSelectionPath() definition code for javax.swing.JTree.getAnchorSelectionPath()

public TreePath sample code for javax.swing.tree.TreePath definition code for javax.swing.tree.TreePath  getAnchorSelectionPath()
Returns the path identified as the anchor.

Returns:
path identified as the anchor
Since:
1.3

getSelectionPath sample code for javax.swing.JTree.getSelectionPath() definition code for javax.swing.JTree.getSelectionPath()

public TreePath sample code for javax.swing.tree.TreePath definition code for javax.swing.tree.TreePath  getSelectionPath()
Returns the path to the first selected node.

Returns:
the TreePath for the first selected node, or null if nothing is currently selected

getSelectionPaths sample code for javax.swing.JTree.getSelectionPaths() definition code for javax.swing.JTree.getSelectionPaths()

public TreePath sample code for javax.swing.tree.TreePath definition code for javax.swing.tree.TreePath [] getSelectionPaths()
Returns the paths of all selected values.

Returns:
an array of TreePath objects indicating the selected nodes, or null if nothing is currently selected

getSelectionRows sample code for javax.swing.JTree.getSelectionRows() definition code for javax.swing.JTree.getSelectionRows()

public int[] getSelectionRows()
Returns all of the currently selected rows. This method is simply forwarded to the TreeSelectionModel. If nothing is selected null or an empty array will be returned, based on the TreeSelectionModel implementation.

Returns:
an array of integers that identifies all currently selected rows where 0 is the first row in the display

getSelectionCount sample code for javax.swing.JTree.getSelectionCount() definition code for javax.swing.JTree.getSelectionCount()

public int getSelectionCount()
Returns the number of nodes selected.

Returns:
the number of nodes selected

getMinSelectionRow sample code for javax.swing.JTree.getMinSelectionRow() definition code for javax.swing.JTree.getMinSelectionRow()

public int getMinSelectionRow()
Gets the first selected row.

Returns:
an integer designating the first selected row, where 0 is the first row in the display

getMaxSelectionRow sample code for javax.swing.JTree.getMaxSelectionRow() definition code for javax.swing.JTree.getMaxSelectionRow()

public int getMaxSelectionRow()
Returns the last selected row.

Returns:
an integer designating the last selected row, where 0 is the first row in the display

getLeadSelectionRow sample code for javax.swing.JTree.getLeadSelectionRow() definition code for javax.swing.JTree.getLeadSelectionRow()

public int getLeadSelectionRow()
Returns the row index corresponding to the lead path.

Returns:
an integer giving the row index of the lead path, where 0 is the first row in the display; or -1 if leadPath is null

isPathSelected sample code for javax.swing.JTree.isPathSelected(javax.swing.tree.TreePath) definition code for javax.swing.JTree.isPathSelected(javax.swing.tree.TreePath)

public boolean isPathSelected(TreePath sample code for javax.swing.tree.TreePath definition code for javax.swing.tree.TreePath  path)
Returns true if the item identified by the path is currently selected.

Parameters:
path - a TreePath identifying a node
Returns:
true if the node is selected

isRowSelected sample code for javax.swing.JTree.isRowSelected(int) definition code for javax.swing.JTree.isRowSelected(int)

public boolean isRowSelected(int row)
Returns true if the node identified by row is selected.

Parameters:
row - an integer specifying a display row, where 0 is the first row in the display
Returns:
true if the node is selected

getExpandedDescendants sample code for javax.swing.JTree.getExpandedDescendants(javax.swing.tree.TreePath) definition code for javax.swing.JTree.getExpandedDescendants(javax.swing.tree.TreePath)

public Enumeration sample code for java.util.Enumeration definition code for java.util.Enumeration <TreePath sample code for javax.swing.tree.TreePath definition code for javax.swing.tree.TreePath > getExpandedDescendants(TreePath sample code for javax.swing.tree.TreePath definition code for javax.swing.tree.TreePath  parent)
Returns an Enumeration of the descendants of the path parent that are currently expanded. If parent is not currently expanded, this will return null. If you expand/collapse nodes while iterating over the returned Enumeration this may not return all the expanded paths, or may return paths that are no longer expanded.

Parameters:
parent - the path which is to be examined
Returns:
an Enumeration of the descendents of parent, or null if parent is not currently expanded

hasBeenExpanded sample code for javax.swing.JTree.hasBeenExpanded(javax.swing.tree.TreePath) definition code for javax.swing.JTree.hasBeenExpanded(javax.swing.tree.TreePath)

public boolean hasBeenExpanded(TreePath sample code for javax.swing.tree.TreePath definition code for javax.swing.tree.TreePath  path)
Returns true if the node identified by the path has ever been expanded.

Returns:
true if the path has ever been expanded

isExpanded sample code for javax.swing.JTree.isExpanded(javax.swing.tree.TreePath) definition code for javax.swing.JTree.isExpanded(javax.swing.tree.TreePath)

public boolean isExpanded(TreePath sample code for javax.swing.tree.TreePath definition code for javax.swing.tree.TreePath  path)
Returns true if the node identified by the path is currently expanded,

Parameters:
path - the TreePath specifying the node to check
Returns:
false if any of the nodes in the node's path are collapsed, true if all nodes in the path are expanded

isExpanded sample code for javax.swing.JTree.isExpanded(int) definition code for javax.swing.JTree.isExpanded(int)

public boolean isExpanded(int row)
Returns true if the node at the specified display row is currently expanded.

Parameters:
row - the row to check, where 0 is the first row in the display
Returns:
true if the node is currently expanded, otherwise false

isCollapsed sample code for javax.swing.JTree.isCollapsed(javax.swing.tree.TreePath) definition code for javax.swing.JTree.isCollapsed(javax.swing.tree.TreePath)

public boolean isCollapsed(TreePath sample code for javax.swing.tree.TreePath definition code for javax.swing.tree.TreePath  path)
Returns true if the value identified by path is currently collapsed, this will return false if any of the values in path are currently not being displayed.

Parameters:
path - the TreePath to check
Returns:
true if any of the nodes in the node's path are collapsed, false if all nodes in the path are expanded

isCollapsed sample code for javax.swing.JTree.isCollapsed(int) definition code for javax.swing.JTree.isCollapsed(int)

public boolean isCollapsed(int row)
Returns true if the node at the specified display row is collapsed.

Parameters:
row - the row to check, where 0 is the first row in the display
Returns:
true if the node is currently collapsed, otherwise false

makeVisible sample code for javax.swing.JTree.makeVisible(javax.swing.tree.TreePath) definition code for javax.swing.JTree.makeVisible(javax.swing.tree.TreePath)

public void makeVisible(TreePath sample code for javax.swing.tree.TreePath definition code for javax.swing.tree.TreePath  path)
Ensures that the node identified by path is currently viewable.

Parameters:
path - the TreePath to make visible

isVisible sample code for javax.swing.JTree.isVisible(javax.swing.tree.TreePath) definition code for javax.swing.JTree.isVisible(javax.swing.tree.TreePath)

public boolean isVisible(TreePath sample code for javax.swing.tree.TreePath definition code for javax.swing.tree.TreePath  path)
Returns true if the value identified by path is currently viewable, which means it is either the root or all of its parents are expanded. Otherwise, this method returns false.

Returns:
true if the node is viewable, otherwise false

getPathBounds sample code for javax.swing.JTree.getPathBounds(javax.swing.tree.TreePath) definition code for javax.swing.JTree.getPathBounds(javax.swing.tree.TreePath)

public Rectangle sample code for java.awt.Rectangle definition code for java.awt.Rectangle  getPathBounds(TreePath sample code for javax.swing.tree.TreePath definition code for javax.swing.tree.TreePath  path)
Returns the Rectangle that the specified node will be drawn into. Returns null if any component in the path is hidden (under a collapsed parent).

Note:
This method returns a valid rectangle, even if the specified node is not currently displayed.

Parameters:
path - the TreePath identifying the node
Returns:
the Rectangle the node is drawn in, or null

getRowBounds sample code for javax.swing.JTree.getRowBounds(int) definition code for javax.swing.JTree.getRowBounds(int)

public Rectangle sample code for java.awt.Rectangle definition code for java.awt.Rectangle  getRowBounds(int row)
Returns the Rectangle that the node at the specified row is drawn in.

Parameters:
row - the row to be drawn, where 0 is the first row in the display
Returns:
the Rectangle the node is drawn in

scrollPathToVisible sample code for javax.swing.JTree.scrollPathToVisible(javax.swing.tree.TreePath) definition code for javax.swing.JTree.scrollPathToVisible(javax.swing.tree.TreePath)

public void scrollPathToVisible(TreePath sample code for javax.swing.tree.TreePath definition code for javax.swing.tree.TreePath  path)
Makes sure all the path components in path are expanded (except for the last path component) and scrolls so that the node identified by the path is displayed. Only works when this JTree is contained in a JScrollPane.

Parameters:
path - the TreePath identifying the node to bring into view

scrollRowToVisible sample code for javax.swing.JTree.scrollRowToVisible(int) definition code for javax.swing.JTree.scrollRowToVisible(int)

public void scrollRowToVisible(int row)
Scrolls the item identified by row until it is displayed. The minimum of amount of scrolling necessary to bring the row into view is performed. Only works when this JTree is contained in a JScrollPane.

Parameters:
row - an integer specifying the row to scroll, where 0 is the first row in the display

getPathForRow sample code for javax.swing.JTree.getPathForRow(int) definition code for javax.swing.JTree.getPathForRow(int)

public TreePath sample code for javax.swing.tree.TreePath definition code for javax.swing.tree.TreePath  getPathForRow(int row)
Returns the path for the specified row. If row is not visible, null is returned.

Parameters:
row - an integer specifying a row
Returns:
the TreePath to the specified node, null if row < 0 or row > getRowCount()

getRowForPath sample code for javax.swing.JTree.getRowForPath(javax.swing.tree.TreePath) definition code for javax.swing.JTree.getRowForPath(javax.swing.tree.TreePath)

public int getRowForPath(TreePath sample code for javax.swing.tree.TreePath definition code for javax.swing.tree.TreePath  path)
Returns the row that displays the node identified by the specified path.

Parameters:
path - the TreePath identifying a node
Returns:
an integer specifying the display row, where 0 is the first row in the display, or -1 if any of the elements in path are hidden under a collapsed parent.

expandPath sample code for javax.swing.JTree.expandPath(javax.swing.tree.TreePath) definition code for javax.swing.JTree.expandPath(javax.swing.tree.TreePath)

public void expandPath(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. If the last item in the path is a leaf, this will have no effect.

Parameters:
path - the TreePath identifying a node

expandRow sample code for javax.swing.JTree.expandRow(int) definition code for javax.swing.JTree.expandRow(int)

public void expandRow(int row)
Ensures that the node in the specified row is expanded and viewable.

If row is < 0 or >= getRowCount this will have no effect.

Parameters:
row - an integer specifying a display row, where 0 is the first row in the display

collapsePath sample code for javax.swing.JTree.collapsePath(javax.swing.tree.TreePath) definition code for javax.swing.JTree.collapsePath(javax.swing.tree.TreePath)

public void collapsePath(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.

Parameters:
path - the TreePath identifying a node

collapseRow sample code for javax.swing.JTree.collapseRow(int) definition code for javax.swing.JTree.collapseRow(int)

public void collapseRow(int row)
Ensures that the node in the specified row is collapsed.

If row is < 0 or >= getRowCount this will have no effect.

Parameters:
row - an integer specifying a display row, where 0 is the first row in the display

getPathForLocation sample code for javax.swing.JTree.getPathForLocation(int, int) definition code for javax.swing.JTree.getPathForLocation(int, int)

public TreePath sample code for javax.swing.tree.TreePath definition code for javax.swing.tree.TreePath  getPathForLocation(int x,
                                   int y)
Returns the path for the node at the specified location.

Parameters:
x - an integer giving the number of pixels horizontally from the left edge of the display area, minus any left margin
y - an integer giving the number of pixels vertically from the top of the display area, minus any top margin
Returns:
the TreePath for the node at that location

getRowForLocation sample code for javax.swing.JTree.getRowForLocation(int, int) definition code for javax.swing.JTree.getRowForLocation(int, int)

public int getRowForLocation(int x,
                             int y)
Returns the row for the specified location.

Parameters:
x - an integer giving the number of pixels horizontally from the left edge of the display area, minus any left margin
y - an integer giving the number of pixels vertically from the top of the display area, minus any top margin
Returns:
the row corresponding to the location, or -1 if the location is not within the bounds of a displayed cell
See Also:
getClosestRowForLocation(int, int) sample code for javax.swing.JTree.getClosestRowForLocation(int, int) definition code for javax.swing.JTree.getClosestRowForLocation(int, int)

getClosestPathForLocation sample code for javax.swing.JTree.getClosestPathForLocation(int, int) definition code for javax.swing.JTree.getClosestPathForLocation(int, int)

public TreePath sample code for javax.swing.tree.TreePath definition code for javax.swing.tree.TreePath  getClosestPathForLocation(int x,
                                          int y)
Returns the path to the node that is closest to x,y. If no nodes are currently viewable, or there is no model, returns null, otherwise it always returns a valid path. To test if the node is exactly at x, y, get the node's bounds and test x, y against that.

Parameters:
x - an integer giving the number of pixels horizontally from the left edge of the display area, minus any left margin
y - an integer giving the number of pixels vertically from the top of the display area, minus any top margin
Returns:
the TreePath for the node closest to that location, null if nothing is viewable or there is no model
See Also:
getPathForLocation(int, int) sample code for javax.swing.JTree.getPathForLocation(int, int) definition code for javax.swing.JTree.getPathForLocation(int, int) , getPathBounds(javax.swing.tree.TreePath) sample code for javax.swing.JTree.getPathBounds(javax.swing.tree.TreePath) definition code for javax.swing.JTree.getPathBounds(javax.swing.tree.TreePath)

getClosestRowForLocation sample code for javax.swing.JTree.getClosestRowForLocation(int, int) definition code for javax.swing.JTree.getClosestRowForLocation(int, int)

public int getClosestRowForLocation(int x,
                                    int y)
Returns the row to the node that is closest to x,y. If no nodes are viewable or there is no model, returns -1. Otherwise, it always returns a valid row. To test if the returned object is exactly at x, y, get the bounds for the node at the returned row and test x, y against that.

Parameters:
x - an integer giving the number of pixels horizontally from the left edge of the display area, minus any left margin
y - an integer giving the number of pixels vertically from the top of the display area, minus any top margin
Returns:
the row closest to the location, -1 if nothing is viewable or there is no model
See Also:
getRowForLocation(int, int) sample code for javax.swing.JTree.getRowForLocation(int, int) definition code for javax.swing.JTree.getRowForLocation(int, int) , getRowBounds(int) sample code for javax.swing.JTree.getRowBounds(int) definition code for javax.swing.JTree.getRowBounds(int)

isEditing sample code for javax.swing.JTree.isEditing() definition code for javax.swing.JTree.isEditing()

public boolean isEditing()
Returns true if the tree is being edited. The item that is being edited can be obtained using getSelectionPath.

Returns:
true if the user is currently editing a node
See Also:
getSelectionPath() sample code for javax.swing.JTree.getSelectionPath() definition code for javax.swing.JTree.getSelectionPath()

stopEditing sample code for javax.swing.JTree.stopEditing() definition code for javax.swing.JTree.stopEditing()

public boolean stopEditing()
Ends the current editing session. (The DefaultTreeCellEditor object saves any edits that are currently in progress on a cell. Other implementations may operate differently.) Has no effect if the tree isn't being edited.
Note:
To make edit-saves automatic whenever the user changes their position in the tree, use setInvokesStopCellEditing(boolean) sample code for javax.swing.JTree.setInvokesStopCellEditing(boolean) definition code for javax.swing.JTree.setInvokesStopCellEditing(boolean) .

Returns:
true if editing was in progress and is now stopped, false if editing was not in progress

cancelEditing sample code for javax.swing.JTree.cancelEditing() definition code for javax.swing.JTree.cancelEditing()

public void cancelEditing()
Cancels the current editing session. Has no effect if the tree isn't being edited.


startEditingAtPath sample code for javax.swing.JTree.startEditingAtPath(javax.swing.tree.TreePath) definition code for javax.swing.JTree.startEditingAtPath(javax.swing.tree.TreePath)

public void startEditingAtPath(TreePath sample code for javax.swing.tree.TreePath definition code for javax.swing.tree.TreePath  path)
Selects the node identified by the specified path and initiates editing. The edit-attempt fails if the CellEditor does not allow editing for the specified item.

Parameters:
path - the TreePath identifying a node

getEditingPath sample code for javax.swing.JTree.getEditingPath() definition code for javax.swing.JTree.getEditingPath()

public TreePath sample code for javax.swing.tree.TreePath definition code for javax.swing.tree.TreePath  getEditingPath()
Returns the path to the element that is currently being edited.

Returns:
the TreePath for the node being edited

setSelectionModel sample code for javax.swing.JTree.setSelectionModel(javax.swing.tree.TreeSelectionModel) definition code for javax.swing.JTree.setSelectionModel(javax.swing.tree.TreeSelectionModel)

public void setSelectionModel(TreeSelectionModel sample code for javax.swing.tree.TreeSelectionModel definition code for javax.swing.tree.TreeSelectionModel  selectionModel)
Sets the tree's selection model. When a null value is specified an emtpy selectionModel is used, which does not allow selections.

Parameters:
selectionModel - the TreeSelectionModel to use, or null to disable selections
See Also:
TreeSelectionModel sample code for javax.swing.tree.TreeSelectionModel definition code for javax.swing.tree.TreeSelectionModel

getSelectionModel sample code for javax.swing.JTree.getSelectionModel() definition code for javax.swing.JTree.getSelectionModel()

public TreeSelectionModel sample code for javax.swing.tree.TreeSelectionModel definition code for javax.swing.tree.TreeSelectionModel  getSelectionModel()
Returns the model for selections. This should always return a non-null value. If you don't want to allow anything to be selected set the selection model to null, which forces an empty selection model to be used.

See Also:
setSelectionModel(javax.swing.tree.TreeSelectionModel) sample code for javax.swing.JTree.setSelectionModel(javax.swing.tree.TreeSelectionModel) definition code for javax.swing.JTree.setSelectionModel(javax.swing.tree.TreeSelectionModel)

getPathBetweenRows sample code for javax.swing.JTree.getPathBetweenRows(int, int) definition code for javax.swing.JTree.getPathBetweenRows(int, int)

protected TreePath sample code for javax.swing.tree.TreePath definition code for javax.swing.tree.TreePath [] getPathBetweenRows(int index0,
                                        int index1)
Returns JTreePath instances representing the path between index0 and index1 (including index1). Returns null if there is no tree.

Parameters:
index0 - an integer specifying a display row, where 0 is the first row in the display
index1 - an integer specifying a second display row
Returns:
an array of TreePath objects, one for each node between index0 and index1, inclusive; or null if there is no tree

setSelectionInterval sample code for javax.swing.JTree.setSelectionInterval(int, int) definition code for javax.swing.JTree.setSelectionInterval(int, int)

public void setSelectionInterval(int index0,
                                 int index1)
Selects the nodes between index0 and index1, inclusive.

Parameters:
index0 - an integer specifying a display row, where 0 is the first row in the display
index1 - an integer specifying a second display row

addSelectionInterval sample code for javax.swing.JTree.addSelectionInterval(int, int) definition code for javax.swing.JTree.addSelectionInterval(int, int)

public void addSelectionInterval(int index0,
                                 int index1)
Adds the paths between index0 and index1, inclusive, to the selection.

Parameters:
index0 - an integer specifying a display row, where 0 is the first row in the display
index1 - an integer specifying a second display row

removeSelectionInterval sample code for javax.swing.JTree.removeSelectionInterval(int, int) definition code for javax.swing.JTree.removeSelectionInterval(int, int)

public void removeSelectionInterval(int index0,
                                    int index1)
Removes the nodes between index0 and index1, inclusive, from the selection.

Parameters:
index0 - an integer specifying a display row, where 0 is the first row in the display
index1 - an integer specifying a second display row

removeSelectionPath sample code for javax.swing.JTree.removeSelectionPath(javax.swing.tree.TreePath) definition code for javax.swing.JTree.removeSelectionPath(javax.swing.tree.TreePath)

public void removeSelectionPath(TreePath sample code for javax.swing.tree.TreePath definition code for javax.swing.tree.TreePath  path)
Removes the node identified by the specified path from the current selection.

Parameters:
path - the TreePath identifying a node

removeSelectionPaths sample code for javax.swing.JTree.removeSelectionPaths(javax.swing.tree.TreePath[]) definition code for javax.swing.JTree.removeSelectionPaths(javax.swing.tree.TreePath[])

public void removeSelectionPaths(TreePath sample code for javax.swing.tree.TreePath definition code for javax.swing.tree.TreePath [] paths)
Removes the nodes identified by the specified paths from the current selection.

Parameters:
paths - an array of TreePath objects that specifies the nodes to remove

removeSelectionRow sample code for javax.swing.JTree.removeSelectionRow(int) definition code for javax.swing.JTree.removeSelectionRow(int)

public void removeSelectionRow(int row)
Removes the row at the index row from the current selection.

Parameters:
row - the row to remove

removeSelectionRows sample code for javax.swing.JTree.removeSelectionRows(int[]) definition code for javax.swing.JTree.removeSelectionRows(int[])

public void removeSelectionRows(int[] rows)
Removes the rows that are selected at each of the specified rows.

Parameters:
rows - an array of ints specifying display rows, where 0 is the first row in the display

clearSelection sample code for javax.swing.JTree.clearSelection() definition code for javax.swing.JTree.clearSelection()

public void clearSelection()
Clears the selection.


isSelectionEmpty sample code for javax.swing.JTree.isSelectionEmpty() definition code for javax.swing.JTree.isSelectionEmpty()

public boolean isSelectionEmpty()
Returns true if the selection is currently empty.

Returns:
true if the selection is currently empty

addTreeExpansionListener sample code for javax.swing.JTree.addTreeExpansionListener(javax.swing.event.TreeExpansionListener) definition code for javax.swing.JTree.addTreeExpansionListener(javax.swing.event.TreeExpansionListener)

public void addTreeExpansionListener(TreeExpansionListener sample code for javax.swing.event.TreeExpansionListener definition code for javax.swing.event.TreeExpansionListener  tel)
Adds a listener for TreeExpansion events.

Parameters:
tel - a TreeExpansionListener that will be notified when a tree node is expanded or collapsed (a "negative expansion")

removeTreeExpansionListener sample code for javax.swing.JTree.removeTreeExpansionListener(javax.swing.event.TreeExpansionListener) definition code for javax.swing.JTree.removeTreeExpansionListener(javax.swing.event.TreeExpansionListener)

public void removeTreeExpansionListener(TreeExpansionListener sample code for javax.swing.event.TreeExpansionListener definition code for javax.swing.event.TreeExpansionListener  tel)
Removes a listener for TreeExpansion events.

Parameters:
tel - the TreeExpansionListener to remove

getTreeExpansionListeners sample code for javax.swing.JTree.getTreeExpansionListeners() definition code for javax.swing.JTree.getTreeExpansionListeners()

public TreeExpansionListener sample code for javax.swing.event.TreeExpansionListener definition code for javax.swing.event.TreeExpansionListener [] getTreeExpansionListeners()
Returns an array of all the TreeExpansionListeners added to this JTree with addTreeExpansionListener().

Returns:
all of the TreeExpansionListeners added or an empty array if no listeners have been added
Since:
1.4

addTreeWillExpandListener sample code for javax.swing.JTree.addTreeWillExpandListener(javax.swing.event.TreeWillExpandListener) definition code for javax.swing.JTree.addTreeWillExpandListener(javax.swing.event.TreeWillExpandListener)

public void addTreeWillExpandListener(TreeWillExpandListener sample code for javax.swing.event.TreeWillExpandListener definition code for javax.swing.event.TreeWillExpandListener  tel)
Adds a listener for TreeWillExpand events.

Parameters:
tel - a TreeWillExpandListener that will be notified when a tree node will be expanded or collapsed (a "negative expansion")

removeTreeWillExpandListener sample code for javax.swing.JTree.removeTreeWillExpandListener(javax.swing.event.TreeWillExpandListener) definition code for javax.swing.JTree.removeTreeWillExpandListener(javax.swing.event.TreeWillExpandListener)

public void removeTreeWillExpandListener(TreeWillExpandListener sample code for javax.swing.event.TreeWillExpandListener definition code for javax.swing.event.TreeWillExpandListener  tel)
Removes a listener for TreeWillExpand events.

Parameters:
tel - the TreeWillExpandListener to remove

getTreeWillExpandListeners sample code for javax.swing.JTree.getTreeWillExpandListeners() definition code for javax.swing.JTree.getTreeWillExpandListeners()

public TreeWillExpandListener sample code for javax.swing.event.TreeWillExpandListener definition code for javax.swing.event.TreeWillExpandListener [] getTreeWillExpandListeners()
Returns an array of all the TreeWillExpandListeners added to this JTree with addTreeWillExpandListener().

Returns:
all of the TreeWillExpandListeners added or an empty array if no listeners have been added
Since:
1.4

fireTreeExpanded sample code for javax.swing.JTree.fireTreeExpanded(javax.swing.tree.TreePath) definition code for javax.swing.JTree.fireTreeExpanded(javax.swing.tree.TreePath)

public void fireTreeExpanded(TreePath sample code for javax.swing.tree.TreePath definition code for javax.swing.tree.TreePath  path)
Notifies all listeners that have registered interest for notification on this event type. The event instance is lazily created using the path parameter.

Parameters:
path - the TreePath indicating the node that was expanded
See Also:
EventListenerList sample code for javax.swing.event.EventListenerList definition code for javax.swing.event.EventListenerList

fireTreeCollapsed sample code for javax.swing.JTree.fireTreeCollapsed(javax.swing.tree.TreePath) definition code for javax.swing.JTree.fireTreeCollapsed(javax.swing.tree.TreePath)

public void fireTreeCollapsed(TreePath sample code for javax.swing.tree.TreePath definition code for javax.swing.tree.TreePath  path)
Notifies all listeners that have registered interest for notification on this event type. The event instance is lazily created using the path parameter.

Parameters:
path - the TreePath indicating the node that was collapsed
See Also:
EventListenerList sample code for javax.swing.event.EventListenerList definition code for javax.swing.event.EventListenerList

fireTreeWillExpand sample code for javax.swing.JTree.fireTreeWillExpand(javax.swing.tree.TreePath) definition code for javax.swing.JTree.fireTreeWillExpand(javax.swing.tree.TreePath)

public void fireTreeWillExpand(TreePath sample code for javax.swing.tree.TreePath definition code for javax.swing.tree.TreePath  path)
                        throws ExpandVetoException sample code for javax.swing.tree.ExpandVetoException definition code for javax.swing.tree.ExpandVetoException 
Notifies all listeners that have registered interest for notification on this event type. The event instance is lazily created using the path parameter.

Parameters:
path - the TreePath indicating the node that was expanded
Throws:
ExpandVetoException sample code for javax.swing.tree.ExpandVetoException definition code for javax.swing.tree.ExpandVetoException
See Also:
EventListenerList sample code for javax.swing.event.EventListenerList definition code for javax.swing.event.EventListenerList

fireTreeWillCollapse sample code for javax.swing.JTree.fireTreeWillCollapse(javax.swing.tree.TreePath) definition code for javax.swing.JTree.fireTreeWillCollapse(javax.swing.tree.TreePath)

public void fireTreeWillCollapse(TreePath sample code for javax.swing.tree.TreePath definition code for javax.swing.tree.TreePath  path)
                          throws ExpandVetoException sample code for javax.swing.tree.ExpandVetoException definition code for javax.swing.tree.ExpandVetoException 
Notifies all listeners that have registered interest for notification on this event type. The event instance is lazily created using the path parameter.

Parameters:
path - the TreePath indicating the node that was expanded
Throws:
ExpandVetoException sample code for javax.swing.tree.ExpandVetoException definition code for javax.swing.tree.ExpandVetoException
See Also:
EventListenerList sample code for javax.swing.event.EventListenerList definition code for javax.swing.event.EventListenerList

addTreeSelectionListener sample code for javax.swing.JTree.addTreeSelectionListener(javax.swing.event.TreeSelectionListener) definition code for javax.swing.JTree.addTreeSelectionListener(javax.swing.event.TreeSelectionListener)

public void addTreeSelectionListener(TreeSelectionListener sample code for javax.swing.event.TreeSelectionListener definition code for javax.swing.event.TreeSelectionListener  tsl)
Adds a listener for TreeSelection events.

Parameters:
tsl - the TreeSelectionListener that will be notified when a node is selected or deselected (a "negative selection")

removeTreeSelectionListener sample code for javax.swing.JTree.removeTreeSelectionListener(javax.swing.event.TreeSelectionListener) definition code for javax.swing.JTree.removeTreeSelectionListener(javax.swing.event.TreeSelectionListener)

public void removeTreeSelectionListener(TreeSelectionListener sample code for javax.swing.event.TreeSelectionListener definition code for javax.swing.event.TreeSelectionListener  tsl)
Removes a TreeSelection listener.

Parameters:
tsl - the TreeSelectionListener to remove

getTreeSelectionListeners sample code for javax.swing.JTree.getTreeSelectionListeners() definition code for javax.swing.JTree.getTreeSelectionListeners()

public TreeSelectionListener sample code for javax.swing.event.TreeSelectionListener definition code for javax.swing.event.TreeSelectionListener [] getTreeSelectionListeners()
Returns an array of all the TreeSelectionListeners added to this JTree with addTreeSelectionListener().

Returns:
all of the TreeSelectionListeners added or an empty array if no listeners have been added
Since:
1.4

fireValueChanged sample code for javax.swing.JTree.fireValueChanged(javax.swing.event.TreeSelectionEvent) definition code for javax.swing.JTree.fireValueChanged(javax.swing.event.TreeSelectionEvent)

protected void fireValueChanged(TreeSelectionEvent sample code for javax.swing.event.TreeSelectionEvent definition code for javax.swing.event.TreeSelectionEvent  e)
Notifies all listeners that have registered interest for notification on this event type.

Parameters:
e - the TreeSelectionEvent to be fired; generated by the TreeSelectionModel when a node is selected or deselected
See Also:
EventListenerList sample code for javax.swing.event.EventListenerList definition code for javax.swing.event.EventListenerList

treeDidChange sample code for javax.swing.JTree.treeDidChange() definition code for javax.swing.JTree.treeDidChange()

public void treeDidChange()
Sent when the tree has changed enough that we need to resize the bounds, but not enough that we need to remove the expanded node set (e.g nodes were expanded or collapsed, or nodes were inserted into the tree). You should never have to invoke this, the UI will invoke this as it needs to.


setVisibleRowCount sample code for javax.swing.JTree.setVisibleRowCount(int) definition code for javax.swing.JTree.setVisibleRowCount(int)

public void setVisibleRowCount(int newCount)
Sets the number of rows that are to be displayed. This will only work if the tree is contained in a JScrollPane, and will adjust the preferred size and size of that scrollpane.

Parameters:
newCount - the number of rows to display

getVisibleRowCount sample code for javax.swing.JTree.getVisibleRowCount() definition code for javax.swing.JTree.getVisibleRowCount()

public int getVisibleRowCount()
Returns the number of rows that are displayed in the display area.

Returns:
the number of rows displayed

getNextMatch sample code for javax.swing.JTree.getNextMatch(java.lang.String, int, javax.swing.text.Position.Bias) definition code for javax.swing.JTree.getNextMatch(java.lang.String, int, javax.swing.text.Position.Bias)

public TreePath sample code for javax.swing.tree.TreePath definition code for javax.swing.tree.TreePath  getNextMatch(String sample code for java.lang.String definition code for java.lang.String  prefix,
                             int startingRow,
                             Position.Bias sample code for javax.swing.text.Position.Bias definition code for javax.swing.text.Position.Bias  bias)
Returns the TreePath to the next tree element that begins with a prefix. To handle the conversion of a TreePath into a String, convertValueToText is used.

Parameters:
prefix - the string to test for a match
startingRow - the row for starting the search
bias - the search direction, either Position.Bias.Forward or Position.Bias.Backward.
Returns:
the TreePath of the next tree element that starts with the prefix; otherwise null
Throws:
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if prefix is null or startingRow is out of bounds
Since:
1.4

getPreferredScrollableViewportSize sample code for javax.swing.JTree.getPreferredScrollableViewportSize() definition code for javax.swing.JTree.getPreferredScrollableViewportSize()

public Dimension sample code for java.awt.Dimension definition code for java.awt.Dimension  getPreferredScrollableViewportSize()
Returns the preferred display size of a JTree. The height is determined from getVisibleRowCount and the width is the current preferred width.

Specified by:
getPreferredScrollableViewportSize sample code for javax.swing.Scrollable.getPreferredScrollableViewportSize() definition code for javax.swing.Scrollable.getPreferredScrollableViewportSize() in interface Scrollable sample code for javax.swing.Scrollable definition code for javax.swing.Scrollable
Returns:
a Dimension object containing the preferred size
See Also:
JComponent.getPreferredSize() sample code for javax.swing.JComponent.getPreferredSize() definition code for javax.swing.JComponent.getPreferredSize()

getScrollableUnitIncrement sample code for javax.swing.JTree.getScrollableUnitIncrement(java.awt.Rectangle, int, int) definition code for javax.swing.JTree.getScrollableUnitIncrement(java.awt.Rectangle, int, int)

public int getScrollableUnitIncrement(Rectangle sample code for java.awt.Rectangle definition code for java.awt.Rectangle  visibleRect,
                                      int orientation,
                                      int direction)
Returns the amount to increment when scrolling. The amount is the height of the first displayed row that isn't completely in view or, if it is totally displayed, the height of the next row in the scrolling direction.

Specified by:
getScrollableUnitIncrement sample code for javax.swing.Scrollable.getScrollableUnitIncrement(java.awt.Rectangle, int, int) definition code for javax.swing.Scrollable.getScrollableUnitIncrement(java.awt.Rectangle, int, int) in interface Scrollable sample code for javax.swing.Scrollable definition code for javax.swing.Scrollable
Parameters:
visibleRect - the view area visible within the viewport
orientation - either SwingConstants.VERTICAL or SwingConstants.HORIZONTAL
direction - less than zero to scroll up/left, greater than zero for down/right
Returns:
the "unit" increment for scrolling in the specified direction
See Also:
JScrollBar.setUnitIncrement(int) sample code for javax.swing.JScrollBar.setUnitIncrement(int) definition code for javax.swing.JScrollBar.setUnitIncrement(int)

getScrollableBlockIncrement sample code for javax.swing.JTree.getScrollableBlockIncrement(java.awt.Rectangle, int, int) definition code for javax.swing.JTree.getScrollableBlockIncrement(java.awt.Rectangle, int, int)

public int getScrollableBlockIncrement(Rectangle sample code for java.awt.Rectangle definition code for java.awt.Rectangle  visibleRect,
                                       int orientation,
                                       int direction)
Returns the amount for a block increment, which is the height or width of visibleRect, based on orientation.

Specified by:
getScrollableBlockIncrement sample code for javax.swing.Scrollable.getScrollableBlockIncrement(java.awt.Rectangle, int, int) definition code for javax.swing.Scrollable.getScrollableBlockIncrement(java.awt.Rectangle, int, int) in interface Scrollable sample code for javax.swing.Scrollable definition code for javax.swing.Scrollable
Parameters:
visibleRect - the view area visible within the viewport
orientation - either SwingConstants.VERTICAL or SwingConstants.HORIZONTAL
direction - less than zero to scroll up/left, greater than zero for down/right.
Returns:
the "block" increment for scrolling in the specified direction
See Also:
JScrollBar.setBlockIncrement(int) sample code for javax.swing.JScrollBar.setBlockIncrement(int) definition code for javax.swing.JScrollBar.setBlockIncrement(int)

getScrollableTracksViewportWidth sample code for javax.swing.JTree.getScrollableTracksViewportWidth() definition code for javax.swing.JTree.getScrollableTracksViewportWidth()

public boolean getScrollableTracksViewportWidth()
Returns false to indicate that the width of the viewport does not determine the width of the table, unless the preferred width of the tree is smaller than the viewports width. In other words: ensure that the tree is never smaller than its viewport.

Specified by:
getScrollableTracksViewportWidth sample code for javax.swing.Scrollable.getScrollableTracksViewportWidth() definition code for javax.swing.Scrollable.getScrollableTracksViewportWidth() in interface Scrollable sample code for javax.swing.Scrollable definition code for javax.swing.Scrollable
Returns:
false
See Also:
Scrollable.getScrollableTracksViewportWidth() sample code for javax.swing.Scrollable.getScrollableTracksViewportWidth() definition code for javax.swing.Scrollable.getScrollableTracksViewportWidth()

getScrollableTracksViewportHeight sample code for javax.swing.JTree.getScrollableTracksViewportHeight() definition code for javax.swing.JTree.getScrollableTracksViewportHeight()

public boolean getScrollableTracksViewportHeight()
Returns false to indicate that the height of the viewport does not determine the height of the table, unless the preferred height of the tree is smaller than the viewports height. In other words: ensure that the tree is never smaller than its viewport.

Specified by:
getScrollableTracksViewportHeight sample code for javax.swing.Scrollable.getScrollableTracksViewportHeight() definition code for javax.swing.Scrollable.getScrollableTracksViewportHeight() in interface Scrollable sample code for javax.swing.Scrollable definition code for javax.swing.Scrollable
Returns:
false
See Also:
Scrollable.getScrollableTracksViewportHeight() sample code for javax.swing.Scrollable.getScrollableTracksViewportHeight() definition code for javax.swing.Scrollable.getScrollableTracksViewportHeight()

setExpandedState sample code for javax.swing.JTree.setExpandedState(javax.swing.tree.TreePath, boolean) definition code for javax.swing.JTree.setExpandedState(javax.swing.tree.TreePath, boolean)

protected void setExpandedState(TreePath sample code for javax.swing.tree.TreePath definition code for javax.swing.tree.TreePath  path,
                                boolean state)
Sets the expanded state of this JTree. If state is true, all parents of path and path are marked as expanded. If state is false, all parents of path are marked EXPANDED, but path itself is marked collapsed.

This will fail if a TreeWillExpandListener vetos it.


getDescendantToggledPaths sample code for javax.swing.JTree.getDescendantToggledPaths(javax.swing.tree.TreePath) definition code for javax.swing.JTree.getDescendantToggledPaths(javax.swing.tree.TreePath)

protected Enumeration sample code for java.util.Enumeration definition code for java.util.Enumeration <TreePath sample code for javax.swing.tree.TreePath definition code for javax.swing.tree.TreePath > getDescendantToggledPaths(TreePath sample code for javax.swing.tree.TreePath definition code for javax.swing.tree.TreePath  parent)
Returns an Enumeration of TreePaths that have been expanded that are descendants of parent.


removeDescendantToggledPaths sample code for javax.swing.JTree.removeDescendantToggledPaths(java.util.Enumeration<javax.swing.tree.TreePath>) definition code for javax.swing.JTree.removeDescendantToggledPaths(java.util.Enumeration<javax.swing.tree.TreePath>)

protected void removeDescendantToggledPaths(Enumeration sample code for java.util.Enumeration definition code for java.util.Enumeration <TreePath sample code for javax.swing.tree.TreePath definition code for javax.swing.tree.TreePath > toRemove)
Removes any descendants of the TreePaths in toRemove that have been expanded.


clearToggledPaths sample code for javax.swing.JTree.clearToggledPaths() definition code for javax.swing.JTree.clearToggledPaths()

protected void clearToggledPaths()
Clears the cache of toggled tree paths. This does NOT send out any TreeExpansionListener events.


createTreeModelListener sample code for javax.swing.JTree.createTreeModelListener() definition code for javax.swing.JTree.createTreeModelListener()

protected TreeModelListener sample code for javax.swing.event.TreeModelListener definition code for javax.swing.event.TreeModelListener  createTreeModelListener()
Creates and returns an instance of TreeModelHandler. The returned object is responsible for updating the expanded state when the TreeModel changes.

For more information on what expanded state means, see the JTree description above.


removeDescendantSelectedPaths sample code for javax.swing.JTree.removeDescendantSelectedPaths(javax.swing.tree.TreePath, boolean) definition code for javax.swing.JTree.removeDescendantSelectedPaths(javax.swing.tree.TreePath, boolean)

protected boolean removeDescendantSelectedPaths(TreePath sample code for javax.swing.tree.TreePath definition code for javax.swing.tree.TreePath  path,
                                                boolean includePath)
Removes any paths in the selection that are descendants of path. If includePath is true and path is selected, it will be removed from the selection.

Returns:
true if a descendant was selected
Since:
1.3

paramString sample code for javax.swing.JTree.paramString() definition code for javax.swing.JTree.paramString()

protected String sample code for java.lang.String definition code for java.lang.String  paramString()
Returns a string representation of this JTree. This method is intended to be used only for debugging purposes, and the content and format of the returned string may vary between implementations. The returned string may be empty but may not be null.

Overrides:
paramString sample code for javax.swing.JComponent.paramString() definition code for javax.swing.JComponent.paramString() in class JComponent sample code for javax.swing.JComponent definition code for javax.swing.JComponent
Returns:
a string representation of this JTree.

getAccessibleContext sample code for javax.swing.JTree.getAccessibleContext() definition code for javax.swing.JTree.getAccessibleContext()

public AccessibleContext sample code for javax.accessibility.AccessibleContext definition code for javax.accessibility.AccessibleContext  getAccessibleContext()
Gets the AccessibleContext associated with this JTree. For JTrees, the AccessibleContext takes the form of an AccessibleJTree. A new AccessibleJTree instance is created if necessary.

Specified by:
getAccessibleContext sample code for javax.accessibility.Accessible.getAccessibleContext() definition code for javax.accessibility.Accessible.getAccessibleContext() in interface Accessible sample code for javax.accessibility.Accessible definition code for javax.accessibility.Accessible
Overrides:
getAccessibleContext sample code for javax.swing.JComponent.getAccessibleContext() definition code for javax.swing.JComponent.getAccessibleContext() in class JComponent sample code for javax.swing.JComponent definition code for javax.swing.JComponent
Returns:
an AccessibleJTree that serves as the AccessibleContext of this JTree