TreeNode (Java SE 19 & JDK 19) (original) (raw)

All Known Subinterfaces:

[MutableTreeNode](MutableTreeNode.html "interface in javax.swing.tree")

All Known Implementing Classes:

[AbstractDocument.AbstractElement](../text/AbstractDocument.AbstractElement.html "class in javax.swing.text"), [AbstractDocument.BranchElement](../text/AbstractDocument.BranchElement.html "class in javax.swing.text"), [AbstractDocument.LeafElement](../text/AbstractDocument.LeafElement.html "class in javax.swing.text"), [DefaultMutableTreeNode](DefaultMutableTreeNode.html "class in javax.swing.tree"), [DefaultStyledDocument.SectionElement](../text/DefaultStyledDocument.SectionElement.html "class in javax.swing.text"), [HTMLDocument.BlockElement](../text/html/HTMLDocument.BlockElement.html "class in javax.swing.text.html"), [HTMLDocument.RunElement](../text/html/HTMLDocument.RunElement.html "class in javax.swing.text.html"), [JTree.DynamicUtilTreeNode](../JTree.DynamicUtilTreeNode.html "class in javax.swing")


public interface TreeNode

Defines the requirements for an object that can be used as a tree node in a JTree.

Implementations of TreeNode that override equals will typically need to override hashCode as well. Refer to TreeModel for more information. For further information and examples of using tree nodes, see How to Use Tree Nodes in The Java Tutorial.

[children](#children%28%29)()
Returns the children of the receiver as an Enumeration.
boolean
Returns true if the receiver allows children.
[getChildAt](#getChildAt%28int%29)(int childIndex)
Returns the child TreeNode at indexchildIndex.
int
Returns the number of children TreeNodes the receiver contains.
int
Returns the index of node in the receivers children.
[getParent](#getParent%28%29)()
Returns the parent TreeNode of the receiver.
boolean
[isLeaf](#isLeaf%28%29)()
Returns true if the receiver is a leaf.