JTree (Java Platform SE 8 ) (original) (raw)
Modifier and Type
Method
Description
void
[addSelectionInterval](../../javax/swing/JTree.html#addSelectionInterval-int-int-)(int index0, int index1)
Adds the specified rows (inclusive) to the selection.
void
[addSelectionPath](../../javax/swing/JTree.html#addSelectionPath-javax.swing.tree.TreePath-)([TreePath](../../javax/swing/tree/TreePath.html "class in javax.swing.tree") path)
Adds the node identified by the specified TreePath
to the current selection.
void
[addSelectionPaths](../../javax/swing/JTree.html#addSelectionPaths-javax.swing.tree.TreePath:A-)([TreePath](../../javax/swing/tree/TreePath.html "class in javax.swing.tree")[] paths)
Adds each path in the array of paths to the current selection.
void
[addSelectionRow](../../javax/swing/JTree.html#addSelectionRow-int-)(int row)
Adds the path at the specified row to the current selection.
void
[addSelectionRows](../../javax/swing/JTree.html#addSelectionRows-int:A-)(int[] rows)
Adds the paths at each of the specified rows to the current selection.
void
[addTreeExpansionListener](../../javax/swing/JTree.html#addTreeExpansionListener-javax.swing.event.TreeExpansionListener-)([TreeExpansionListener](../../javax/swing/event/TreeExpansionListener.html "interface in javax.swing.event") tel)
Adds a listener for TreeExpansion
events.
void
[addTreeSelectionListener](../../javax/swing/JTree.html#addTreeSelectionListener-javax.swing.event.TreeSelectionListener-)([TreeSelectionListener](../../javax/swing/event/TreeSelectionListener.html "interface in javax.swing.event") tsl)
Adds a listener for TreeSelection
events.
void
[addTreeWillExpandListener](../../javax/swing/JTree.html#addTreeWillExpandListener-javax.swing.event.TreeWillExpandListener-)([TreeWillExpandListener](../../javax/swing/event/TreeWillExpandListener.html "interface in javax.swing.event") tel)
Adds a listener for TreeWillExpand
events.
void
[cancelEditing](../../javax/swing/JTree.html#cancelEditing--)()
Cancels the current editing session.
void
[clearSelection](../../javax/swing/JTree.html#clearSelection--)()
Clears the selection.
protected void
[clearToggledPaths](../../javax/swing/JTree.html#clearToggledPaths--)()
Clears the cache of toggled tree paths.
void
[collapsePath](../../javax/swing/JTree.html#collapsePath-javax.swing.tree.TreePath-)([TreePath](../../javax/swing/tree/TreePath.html "class in javax.swing.tree") path)
Ensures that the node identified by the specified path is collapsed and viewable.
void
[collapseRow](../../javax/swing/JTree.html#collapseRow-int-)(int row)
Ensures that the node in the specified row is collapsed.
[String](../../java/lang/String.html "class in java.lang")
[convertValueToText](../../javax/swing/JTree.html#convertValueToText-java.lang.Object-boolean-boolean-boolean-int-boolean-)([Object](../../java/lang/Object.html "class in java.lang") 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](../../javax/swing/tree/TreeModel.html "interface in javax.swing.tree")
[createTreeModel](../../javax/swing/JTree.html#createTreeModel-java.lang.Object-)([Object](../../java/lang/Object.html "class in java.lang") value)
Returns a TreeModel
wrapping the specified object.
protected [TreeModelListener](../../javax/swing/event/TreeModelListener.html "interface in javax.swing.event")
[createTreeModelListener](../../javax/swing/JTree.html#createTreeModelListener--)()
Creates and returns an instance of TreeModelHandler
.
void
[expandPath](../../javax/swing/JTree.html#expandPath-javax.swing.tree.TreePath-)([TreePath](../../javax/swing/tree/TreePath.html "class in javax.swing.tree") path)
Ensures that the node identified by the specified path is expanded and viewable.
void
[expandRow](../../javax/swing/JTree.html#expandRow-int-)(int row)
Ensures that the node in the specified row is expanded and viewable.
void
[fireTreeCollapsed](../../javax/swing/JTree.html#fireTreeCollapsed-javax.swing.tree.TreePath-)([TreePath](../../javax/swing/tree/TreePath.html "class in javax.swing.tree") path)
Notifies all listeners that have registered interest for notification on this event type.
void
[fireTreeExpanded](../../javax/swing/JTree.html#fireTreeExpanded-javax.swing.tree.TreePath-)([TreePath](../../javax/swing/tree/TreePath.html "class in javax.swing.tree") path)
Notifies all listeners that have registered interest for notification on this event type.
void
[fireTreeWillCollapse](../../javax/swing/JTree.html#fireTreeWillCollapse-javax.swing.tree.TreePath-)([TreePath](../../javax/swing/tree/TreePath.html "class in javax.swing.tree") path)
Notifies all listeners that have registered interest for notification on this event type.
void
[fireTreeWillExpand](../../javax/swing/JTree.html#fireTreeWillExpand-javax.swing.tree.TreePath-)([TreePath](../../javax/swing/tree/TreePath.html "class in javax.swing.tree") path)
Notifies all listeners that have registered interest for notification on this event type.
protected void
[fireValueChanged](../../javax/swing/JTree.html#fireValueChanged-javax.swing.event.TreeSelectionEvent-)([TreeSelectionEvent](../../javax/swing/event/TreeSelectionEvent.html "class in javax.swing.event") e)
Notifies all listeners that have registered interest for notification on this event type.
[AccessibleContext](../../javax/accessibility/AccessibleContext.html "class in javax.accessibility")
[getAccessibleContext](../../javax/swing/JTree.html#getAccessibleContext--)()
Gets the AccessibleContext associated with this JTree.
[TreePath](../../javax/swing/tree/TreePath.html "class in javax.swing.tree")
[getAnchorSelectionPath](../../javax/swing/JTree.html#getAnchorSelectionPath--)()
Returns the path identified as the anchor.
[TreeCellEditor](../../javax/swing/tree/TreeCellEditor.html "interface in javax.swing.tree")
[getCellEditor](../../javax/swing/JTree.html#getCellEditor--)()
Returns the editor used to edit entries in the tree.
[TreeCellRenderer](../../javax/swing/tree/TreeCellRenderer.html "interface in javax.swing.tree")
[getCellRenderer](../../javax/swing/JTree.html#getCellRenderer--)()
Returns the current TreeCellRenderer
that is rendering each cell.
[TreePath](../../javax/swing/tree/TreePath.html "class in javax.swing.tree")
[getClosestPathForLocation](../../javax/swing/JTree.html#getClosestPathForLocation-int-int-)(int x, int y)
Returns the path to the node that is closest to x,y.
int
[getClosestRowForLocation](../../javax/swing/JTree.html#getClosestRowForLocation-int-int-)(int x, int y)
Returns the row to the node that is closest to x,y.
protected static [TreeModel](../../javax/swing/tree/TreeModel.html "interface in javax.swing.tree")
[getDefaultTreeModel](../../javax/swing/JTree.html#getDefaultTreeModel--)()
Creates and returns a sample TreeModel
.
protected [Enumeration](../../java/util/Enumeration.html "interface in java.util")<[TreePath](../../javax/swing/tree/TreePath.html "class in javax.swing.tree")>
[getDescendantToggledPaths](../../javax/swing/JTree.html#getDescendantToggledPaths-javax.swing.tree.TreePath-)([TreePath](../../javax/swing/tree/TreePath.html "class in javax.swing.tree") parent)
Returns an Enumeration
of TreePaths
that have been expanded that are descendants of parent
.
boolean
[getDragEnabled](../../javax/swing/JTree.html#getDragEnabled--)()
Returns whether or not automatic drag handling is enabled.
[JTree.DropLocation](../../javax/swing/JTree.DropLocation.html "class in javax.swing")
[getDropLocation](../../javax/swing/JTree.html#getDropLocation--)()
Returns the location that this component should visually indicate as the drop location during a DnD operation over the component, or null
if no location is to currently be shown.
[DropMode](../../javax/swing/DropMode.html "enum in javax.swing")
[getDropMode](../../javax/swing/JTree.html#getDropMode--)()
Returns the drop mode for this component.
[TreePath](../../javax/swing/tree/TreePath.html "class in javax.swing.tree")
[getEditingPath](../../javax/swing/JTree.html#getEditingPath--)()
Returns the path to the element that is currently being edited.
[Enumeration](../../java/util/Enumeration.html "interface in java.util")<[TreePath](../../javax/swing/tree/TreePath.html "class in javax.swing.tree")>
[getExpandedDescendants](../../javax/swing/JTree.html#getExpandedDescendants-javax.swing.tree.TreePath-)([TreePath](../../javax/swing/tree/TreePath.html "class in javax.swing.tree") parent)
Returns an Enumeration
of the descendants of the path parent
that are currently expanded.
boolean
[getExpandsSelectedPaths](../../javax/swing/JTree.html#getExpandsSelectedPaths--)()
Returns the expandsSelectedPaths
property.
boolean
[getInvokesStopCellEditing](../../javax/swing/JTree.html#getInvokesStopCellEditing--)()
Returns the indicator that tells what happens when editing is interrupted.
[Object](../../java/lang/Object.html "class in java.lang")
[getLastSelectedPathComponent](../../javax/swing/JTree.html#getLastSelectedPathComponent--)()
Returns the last path component of the selected path.
[TreePath](../../javax/swing/tree/TreePath.html "class in javax.swing.tree")
[getLeadSelectionPath](../../javax/swing/JTree.html#getLeadSelectionPath--)()
Returns the path identified as the lead.
int
[getLeadSelectionRow](../../javax/swing/JTree.html#getLeadSelectionRow--)()
Returns the row index corresponding to the lead path.
int
[getMaxSelectionRow](../../javax/swing/JTree.html#getMaxSelectionRow--)()
Returns the largest selected row.
int
[getMinSelectionRow](../../javax/swing/JTree.html#getMinSelectionRow--)()
Returns the smallest selected row.
[TreeModel](../../javax/swing/tree/TreeModel.html "interface in javax.swing.tree")
[getModel](../../javax/swing/JTree.html#getModel--)()
Returns the TreeModel
that is providing the data.
[TreePath](../../javax/swing/tree/TreePath.html "class in javax.swing.tree")
[getNextMatch](../../javax/swing/JTree.html#getNextMatch-java.lang.String-int-javax.swing.text.Position.Bias-)([String](../../java/lang/String.html "class in java.lang") prefix, int startingRow,[Position.Bias](../../javax/swing/text/Position.Bias.html "class in javax.swing.text") bias)
Returns the TreePath to the next tree element that begins with a prefix.
protected [TreePath](../../javax/swing/tree/TreePath.html "class in javax.swing.tree")[]
[getPathBetweenRows](../../javax/swing/JTree.html#getPathBetweenRows-int-int-)(int index0, int index1)
Returns the paths (inclusive) between the specified rows.
[Rectangle](../../java/awt/Rectangle.html "class in java.awt")
[getPathBounds](../../javax/swing/JTree.html#getPathBounds-javax.swing.tree.TreePath-)([TreePath](../../javax/swing/tree/TreePath.html "class in javax.swing.tree") path)
Returns the Rectangle
that the specified node will be drawn into.
[TreePath](../../javax/swing/tree/TreePath.html "class in javax.swing.tree")
[getPathForLocation](../../javax/swing/JTree.html#getPathForLocation-int-int-)(int x, int y)
Returns the path for the node at the specified location.
[TreePath](../../javax/swing/tree/TreePath.html "class in javax.swing.tree")
[getPathForRow](../../javax/swing/JTree.html#getPathForRow-int-)(int row)
Returns the path for the specified row.
[Dimension](../../java/awt/Dimension.html "class in java.awt")
[getPreferredScrollableViewportSize](../../javax/swing/JTree.html#getPreferredScrollableViewportSize--)()
Returns the preferred display size of a JTree
.
[Rectangle](../../java/awt/Rectangle.html "class in java.awt")
[getRowBounds](../../javax/swing/JTree.html#getRowBounds-int-)(int row)
Returns the Rectangle
that the node at the specified row is drawn in.
int
[getRowCount](../../javax/swing/JTree.html#getRowCount--)()
Returns the number of viewable nodes.
int
[getRowForLocation](../../javax/swing/JTree.html#getRowForLocation-int-int-)(int x, int y)
Returns the row for the specified location.
int
[getRowForPath](../../javax/swing/JTree.html#getRowForPath-javax.swing.tree.TreePath-)([TreePath](../../javax/swing/tree/TreePath.html "class in javax.swing.tree") path)
Returns the row that displays the node identified by the specified path.
int
[getRowHeight](../../javax/swing/JTree.html#getRowHeight--)()
Returns the height of each row.
int
[getScrollableBlockIncrement](../../javax/swing/JTree.html#getScrollableBlockIncrement-java.awt.Rectangle-int-int-)([Rectangle](../../java/awt/Rectangle.html "class in java.awt") 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](../../javax/swing/JTree.html#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](../../javax/swing/JTree.html#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](../../javax/swing/JTree.html#getScrollableUnitIncrement-java.awt.Rectangle-int-int-)([Rectangle](../../java/awt/Rectangle.html "class in java.awt") visibleRect, int orientation, int direction)
Returns the amount to increment when scrolling.
boolean
[getScrollsOnExpand](../../javax/swing/JTree.html#getScrollsOnExpand--)()
Returns the value of the scrollsOnExpand
property.
int
[getSelectionCount](../../javax/swing/JTree.html#getSelectionCount--)()
Returns the number of nodes selected.
[TreeSelectionModel](../../javax/swing/tree/TreeSelectionModel.html "interface in javax.swing.tree")
[getSelectionModel](../../javax/swing/JTree.html#getSelectionModel--)()
Returns the model for selections.
[TreePath](../../javax/swing/tree/TreePath.html "class in javax.swing.tree")
[getSelectionPath](../../javax/swing/JTree.html#getSelectionPath--)()
Returns the path to the first selected node.
[TreePath](../../javax/swing/tree/TreePath.html "class in javax.swing.tree")[]
[getSelectionPaths](../../javax/swing/JTree.html#getSelectionPaths--)()
Returns the paths of all selected values.
int[]
[getSelectionRows](../../javax/swing/JTree.html#getSelectionRows--)()
Returns all of the currently selected rows.
boolean
[getShowsRootHandles](../../javax/swing/JTree.html#getShowsRootHandles--)()
Returns the value of the showsRootHandles
property.
int
[getToggleClickCount](../../javax/swing/JTree.html#getToggleClickCount--)()
Returns the number of mouse clicks needed to expand or close a node.
[String](../../java/lang/String.html "class in java.lang")
[getToolTipText](../../javax/swing/JTree.html#getToolTipText-java.awt.event.MouseEvent-)([MouseEvent](../../java/awt/event/MouseEvent.html "class in java.awt.event") event)
Overrides JComponent
's getToolTipText
method in order to allow renderer's tips to be used if it has text set.
[TreeExpansionListener](../../javax/swing/event/TreeExpansionListener.html "interface in javax.swing.event")[]
[getTreeExpansionListeners](../../javax/swing/JTree.html#getTreeExpansionListeners--)()
Returns an array of all the TreeExpansionListener
s added to this JTree with addTreeExpansionListener().
[TreeSelectionListener](../../javax/swing/event/TreeSelectionListener.html "interface in javax.swing.event")[]
[getTreeSelectionListeners](../../javax/swing/JTree.html#getTreeSelectionListeners--)()
Returns an array of all the TreeSelectionListener
s added to this JTree with addTreeSelectionListener().
[TreeWillExpandListener](../../javax/swing/event/TreeWillExpandListener.html "interface in javax.swing.event")[]
[getTreeWillExpandListeners](../../javax/swing/JTree.html#getTreeWillExpandListeners--)()
Returns an array of all the TreeWillExpandListener
s added to this JTree with addTreeWillExpandListener().
[TreeUI](../../javax/swing/plaf/TreeUI.html "class in javax.swing.plaf")
[getUI](../../javax/swing/JTree.html#getUI--)()
Returns the L&F object that renders this component.
[String](../../java/lang/String.html "class in java.lang")
[getUIClassID](../../javax/swing/JTree.html#getUIClassID--)()
Returns the name of the L&F class that renders this component.
int
[getVisibleRowCount](../../javax/swing/JTree.html#getVisibleRowCount--)()
Returns the number of rows that are displayed in the display area.
boolean
[hasBeenExpanded](../../javax/swing/JTree.html#hasBeenExpanded-javax.swing.tree.TreePath-)([TreePath](../../javax/swing/tree/TreePath.html "class in javax.swing.tree") path)
Returns true if the node identified by the path has ever been expanded.
boolean
[isCollapsed](../../javax/swing/JTree.html#isCollapsed-int-)(int row)
Returns true if the node at the specified display row is collapsed.
boolean
[isCollapsed](../../javax/swing/JTree.html#isCollapsed-javax.swing.tree.TreePath-)([TreePath](../../javax/swing/tree/TreePath.html "class in javax.swing.tree") 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](../../javax/swing/JTree.html#isEditable--)()
Returns true if the tree is editable.
boolean
[isEditing](../../javax/swing/JTree.html#isEditing--)()
Returns true if the tree is being edited.
boolean
[isExpanded](../../javax/swing/JTree.html#isExpanded-int-)(int row)
Returns true if the node at the specified display row is currently expanded.
boolean
[isExpanded](../../javax/swing/JTree.html#isExpanded-javax.swing.tree.TreePath-)([TreePath](../../javax/swing/tree/TreePath.html "class in javax.swing.tree") path)
Returns true if the node identified by the path is currently expanded,
boolean
[isFixedRowHeight](../../javax/swing/JTree.html#isFixedRowHeight--)()
Returns true if the height of each display row is a fixed size.
boolean
[isLargeModel](../../javax/swing/JTree.html#isLargeModel--)()
Returns true if the tree is configured for a large model.
boolean
[isPathEditable](../../javax/swing/JTree.html#isPathEditable-javax.swing.tree.TreePath-)([TreePath](../../javax/swing/tree/TreePath.html "class in javax.swing.tree") path)
Returns isEditable
.
boolean
[isPathSelected](../../javax/swing/JTree.html#isPathSelected-javax.swing.tree.TreePath-)([TreePath](../../javax/swing/tree/TreePath.html "class in javax.swing.tree") path)
Returns true if the item identified by the path is currently selected.
boolean
[isRootVisible](../../javax/swing/JTree.html#isRootVisible--)()
Returns true if the root node of the tree is displayed.
boolean
[isRowSelected](../../javax/swing/JTree.html#isRowSelected-int-)(int row)
Returns true if the node identified by row is selected.
boolean
[isSelectionEmpty](../../javax/swing/JTree.html#isSelectionEmpty--)()
Returns true if the selection is currently empty.
boolean
[isVisible](../../javax/swing/JTree.html#isVisible-javax.swing.tree.TreePath-)([TreePath](../../javax/swing/tree/TreePath.html "class in javax.swing.tree") 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](../../javax/swing/JTree.html#makeVisible-javax.swing.tree.TreePath-)([TreePath](../../javax/swing/tree/TreePath.html "class in javax.swing.tree") path)
Ensures that the node identified by path is currently viewable.
protected [String](../../java/lang/String.html "class in java.lang")
[paramString](../../javax/swing/JTree.html#paramString--)()
Returns a string representation of this JTree
.
protected boolean
[removeDescendantSelectedPaths](../../javax/swing/JTree.html#removeDescendantSelectedPaths-javax.swing.tree.TreePath-boolean-)([TreePath](../../javax/swing/tree/TreePath.html "class in javax.swing.tree") path, boolean includePath)
Removes any paths in the selection that are descendants ofpath
.
protected void
[removeDescendantToggledPaths](../../javax/swing/JTree.html#removeDescendantToggledPaths-java.util.Enumeration-)([Enumeration](../../java/util/Enumeration.html "interface in java.util")<[TreePath](../../javax/swing/tree/TreePath.html "class in javax.swing.tree")> toRemove)
Removes any descendants of the TreePaths
intoRemove
that have been expanded.
void
[removeSelectionInterval](../../javax/swing/JTree.html#removeSelectionInterval-int-int-)(int index0, int index1)
Removes the specified rows (inclusive) from the selection.
void
[removeSelectionPath](../../javax/swing/JTree.html#removeSelectionPath-javax.swing.tree.TreePath-)([TreePath](../../javax/swing/tree/TreePath.html "class in javax.swing.tree") path)
Removes the node identified by the specified path from the current selection.
void
[removeSelectionPaths](../../javax/swing/JTree.html#removeSelectionPaths-javax.swing.tree.TreePath:A-)([TreePath](../../javax/swing/tree/TreePath.html "class in javax.swing.tree")[] paths)
Removes the nodes identified by the specified paths from the current selection.
void
[removeSelectionRow](../../javax/swing/JTree.html#removeSelectionRow-int-)(int row)
Removes the row at the index row
from the current selection.
void
[removeSelectionRows](../../javax/swing/JTree.html#removeSelectionRows-int:A-)(int[] rows)
Removes the rows that are selected at each of the specified rows.
void
[removeTreeExpansionListener](../../javax/swing/JTree.html#removeTreeExpansionListener-javax.swing.event.TreeExpansionListener-)([TreeExpansionListener](../../javax/swing/event/TreeExpansionListener.html "interface in javax.swing.event") tel)
Removes a listener for TreeExpansion
events.
void
[removeTreeSelectionListener](../../javax/swing/JTree.html#removeTreeSelectionListener-javax.swing.event.TreeSelectionListener-)([TreeSelectionListener](../../javax/swing/event/TreeSelectionListener.html "interface in javax.swing.event") tsl)
Removes a TreeSelection
listener.
void
[removeTreeWillExpandListener](../../javax/swing/JTree.html#removeTreeWillExpandListener-javax.swing.event.TreeWillExpandListener-)([TreeWillExpandListener](../../javax/swing/event/TreeWillExpandListener.html "interface in javax.swing.event") tel)
Removes a listener for TreeWillExpand
events.
void
[scrollPathToVisible](../../javax/swing/JTree.html#scrollPathToVisible-javax.swing.tree.TreePath-)([TreePath](../../javax/swing/tree/TreePath.html "class in javax.swing.tree") 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](../../javax/swing/JTree.html#scrollRowToVisible-int-)(int row)
Scrolls the item identified by row until it is displayed.
void
[setAnchorSelectionPath](../../javax/swing/JTree.html#setAnchorSelectionPath-javax.swing.tree.TreePath-)([TreePath](../../javax/swing/tree/TreePath.html "class in javax.swing.tree") newPath)
Sets the path identified as the anchor.
void
[setCellEditor](../../javax/swing/JTree.html#setCellEditor-javax.swing.tree.TreeCellEditor-)([TreeCellEditor](../../javax/swing/tree/TreeCellEditor.html "interface in javax.swing.tree") cellEditor)
Sets the cell editor.
void
[setCellRenderer](../../javax/swing/JTree.html#setCellRenderer-javax.swing.tree.TreeCellRenderer-)([TreeCellRenderer](../../javax/swing/tree/TreeCellRenderer.html "interface in javax.swing.tree") x)
Sets the TreeCellRenderer
that will be used to draw each cell.
void
[setDragEnabled](../../javax/swing/JTree.html#setDragEnabled-boolean-)(boolean b)
Turns on or off automatic drag handling.
void
[setDropMode](../../javax/swing/JTree.html#setDropMode-javax.swing.DropMode-)([DropMode](../../javax/swing/DropMode.html "enum in javax.swing") dropMode)
Sets the drop mode for this component.
void
[setEditable](../../javax/swing/JTree.html#setEditable-boolean-)(boolean flag)
Determines whether the tree is editable.
protected void
[setExpandedState](../../javax/swing/JTree.html#setExpandedState-javax.swing.tree.TreePath-boolean-)([TreePath](../../javax/swing/tree/TreePath.html "class in javax.swing.tree") path, boolean state)
Sets the expanded state of this JTree
.
void
[setExpandsSelectedPaths](../../javax/swing/JTree.html#setExpandsSelectedPaths-boolean-)(boolean newValue)
Configures the expandsSelectedPaths
property.
void
[setInvokesStopCellEditing](../../javax/swing/JTree.html#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](../../javax/swing/JTree.html#setLargeModel-boolean-)(boolean newValue)
Specifies whether the UI should use a large model.
void
[setLeadSelectionPath](../../javax/swing/JTree.html#setLeadSelectionPath-javax.swing.tree.TreePath-)([TreePath](../../javax/swing/tree/TreePath.html "class in javax.swing.tree") newPath)
Sets the path identifies as the lead.
void
[setModel](../../javax/swing/JTree.html#setModel-javax.swing.tree.TreeModel-)([TreeModel](../../javax/swing/tree/TreeModel.html "interface in javax.swing.tree") newModel)
Sets the TreeModel
that will provide the data.
void
[setRootVisible](../../javax/swing/JTree.html#setRootVisible-boolean-)(boolean rootVisible)
Determines whether or not the root node from the TreeModel
is visible.
void
[setRowHeight](../../javax/swing/JTree.html#setRowHeight-int-)(int rowHeight)
Sets the height of each cell, in pixels.
void
[setScrollsOnExpand](../../javax/swing/JTree.html#setScrollsOnExpand-boolean-)(boolean newValue)
Sets the scrollsOnExpand
property, which determines whether the tree might scroll to show previously hidden children.
void
[setSelectionInterval](../../javax/swing/JTree.html#setSelectionInterval-int-int-)(int index0, int index1)
Selects the rows in the specified interval (inclusive).
void
[setSelectionModel](../../javax/swing/JTree.html#setSelectionModel-javax.swing.tree.TreeSelectionModel-)([TreeSelectionModel](../../javax/swing/tree/TreeSelectionModel.html "interface in javax.swing.tree") selectionModel)
Sets the tree's selection model.
void
[setSelectionPath](../../javax/swing/JTree.html#setSelectionPath-javax.swing.tree.TreePath-)([TreePath](../../javax/swing/tree/TreePath.html "class in javax.swing.tree") path)
Selects the node identified by the specified path.
void
[setSelectionPaths](../../javax/swing/JTree.html#setSelectionPaths-javax.swing.tree.TreePath:A-)([TreePath](../../javax/swing/tree/TreePath.html "class in javax.swing.tree")[] paths)
Selects the nodes identified by the specified array of paths.
void
[setSelectionRow](../../javax/swing/JTree.html#setSelectionRow-int-)(int row)
Selects the node at the specified row in the display.
void
[setSelectionRows](../../javax/swing/JTree.html#setSelectionRows-int:A-)(int[] rows)
Selects the nodes corresponding to each of the specified rows in the display.
void
[setShowsRootHandles](../../javax/swing/JTree.html#setShowsRootHandles-boolean-)(boolean newValue)
Sets the value of the showsRootHandles
property, which specifies whether the node handles should be displayed.
void
[setToggleClickCount](../../javax/swing/JTree.html#setToggleClickCount-int-)(int clickCount)
Sets the number of mouse clicks before a node will expand or close.
void
[setUI](../../javax/swing/JTree.html#setUI-javax.swing.plaf.TreeUI-)([TreeUI](../../javax/swing/plaf/TreeUI.html "class in javax.swing.plaf") ui)
Sets the L&F object that renders this component.
void
[setVisibleRowCount](../../javax/swing/JTree.html#setVisibleRowCount-int-)(int newCount)
Sets the number of rows that are to be displayed.
void
[startEditingAtPath](../../javax/swing/JTree.html#startEditingAtPath-javax.swing.tree.TreePath-)([TreePath](../../javax/swing/tree/TreePath.html "class in javax.swing.tree") path)
Selects the node identified by the specified path and initiates editing.
boolean
[stopEditing](../../javax/swing/JTree.html#stopEditing--)()
Ends the current editing session.
void
[treeDidChange](../../javax/swing/JTree.html#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](../../javax/swing/JTree.html#updateUI--)()
Notification from the UIManager
that the L&F has changed.