This documentation differs from the official API. Jadeite adds extra features to the API including: variable font sizes, constructions examples, placeholders for classes and methods, and auto-generated “See Also” links. Additionally it is missing some items found in standard Javadoc documentation, including: generics type information, “Deprecated” tags and comments, “See Also” links, along with other minor differences. Please send any questions or feedback to bam@cs.cmu.edu.


javax.swing.tree
interface TreeNode

All Known Subinterfaces:
MutableTreeNode
All Known Implementing Classes:
AbstractDocument.AbstractElement, AbstractDocument.BranchElement, AbstractDocument.LeafElement, DefaultStyledDocument.SectionElement, HTMLDocument.BlockElement, HTMLDocument.RunElement

Most common way to construct:

TreePath path = …;

TreeNode node = (TreeNode)path.getLastPathComponent();

Based on 14 examples


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 {@link 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.


Method Summary
 Enumeration

          Returns the children of the receiver as an Enumeration.
 boolean

          Returns true if the receiver allows children.
 TreeNode
getChildAt(int childIndex)

          Returns the child TreeNode at index childIndex.
 int

          Returns the number of children TreeNodes the receiver contains.
 int

          Returns the index of node in the receivers children.
 TreeNode

          Returns the parent TreeNode of the receiver.
 boolean

          Returns true if the receiver is a leaf.
 

Method Detail

children

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


getAllowsChildren

public boolean getAllowsChildren()
Returns true if the receiver allows children.


getChildAt

public TreeNode getChildAt(int childIndex)
Returns the child TreeNode at index childIndex.

Parameters:
childIndex

getChildCount

public int getChildCount()
Returns the number of children TreeNodes the receiver contains.


getIndex

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.

Parameters:
node

getParent

public TreeNode getParent()
Returns the parent TreeNode of the receiver.


isLeaf

public boolean isLeaf()
Returns true if the receiver is a leaf.



This documentation differs from the official API. Jadeite adds extra features to the API including: variable font sizes, constructions examples, placeholders for classes and methods, and auto-generated “See Also” links. Additionally it is missing some items found in standard Javadoc documentation, including: generics type information, “Deprecated” tags and comments, “See Also” links, along with other minor differences. Please send any questions or feedback to bam@cs.cmu.edu.
This page displays the Jadeite version of the documention, which is derived from the offical documentation that contains this copyright notice:
Copyright 2008 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.
The official Sun™ documentation can be found here at http://java.sun.com/javase/6/docs/api/.