public interface javax.swing.tree
TreeNode


Show All Login
Java SE 6
  
Implemented by: AbstractDocument.AbstractElement, MutableTreeNode
Details
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 javax.swing.tree.TreeModel for more information. For further information and examples of using tree nodes, see How to Use Tree Nodes in The Java Tutorial.
version1.25 11/17/05


Methods
public Enumeration children()
Returns the children of the receiver as an Enumeration.

Properties
public boolean getAllowsChildren()
Returns true if the receiver allows children.
public TreeNode getChildAt(int childIndex)
Returns the child TreeNode at index childIndex.
public int getChildCount()
Returns the number of children TreeNodes the receiver contains.
public int getIndex(TreeNode node)
Returns the index of node in the receivers children. If the receiver does not contain node, -1 will be returned.
public boolean isLeaf()
Returns true if the receiver is a leaf.
public TreeNode getParent()
Returns the parent TreeNode of the receiver.