public interface

TreeNode

javax.swing.tree.TreeNode
Known Indirect Subclasses

Class Overview

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.

Summary

Public Methods
abstract Enumeration children()
Returns the children of the receiver as an Enumeration.
abstract boolean getAllowsChildren()
Returns true if the receiver allows children.
abstract TreeNode getChildAt(int childIndex)
Returns the child TreeNode at index childIndex.
abstract int getChildCount()
Returns the number of children TreeNodes the receiver contains.
abstract int getIndex(TreeNode node)
Returns the index of node in the receivers children.
abstract TreeNode getParent()
Returns the parent TreeNode of the receiver.
abstract boolean isLeaf()
Returns true if the receiver is a leaf.

Public Methods

public abstract Enumeration children ()

Returns the children of the receiver as an Enumeration.

public abstract boolean getAllowsChildren ()

Returns true if the receiver allows children.

public abstract TreeNode getChildAt (int childIndex)

Returns the child TreeNode at index childIndex.

public abstract int getChildCount ()

Returns the number of children TreeNodes the receiver contains.

public abstract 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 abstract TreeNode getParent ()

Returns the parent TreeNode of the receiver.

public abstract boolean isLeaf ()

Returns true if the receiver is a leaf.