Java Reference
In-Depth Information
DefaultMutableTreeNode Properties
As Table 17-5 shows, there are 22 properties of DefaultMutableTreeNode . Most of the properties
are read-only, allowing you to find out information about the tree node's position and relation-
ships. The userObject property contains the data specific to the node that was provided to the
DefaultMutableTreeNode when the node was created. The userObjectPath property contains an
array of user objects, from the root (at index 0) to the current node (which could be the root).
Table 17-5. DefaultMutableTreeNode Properties
Property Name
Data Type
Access
allowsChildren
boolean
Read-write
childCount
int
Read-only
depth
int
Read-only
firstChild
TreeNode
Read-only
firstLeaf
DefaultMutableTreeNode
Read-only
lastChild
TreeNode
Read-only
lastLeaf
DefaultMutableTreeNode
Read-only
leaf
boolean
Read-only
leafCount
int
Read-only
level
int
Read-only
nextLeaf
DefaultMutableTreeNode
Read-only
nextNode
DefaultMutableTreeNode
Read-only
nextSibling
DefaultMutableTreeNode
Read-only
parent
MutableTreeNode
Read-write
path
TreeNode[ ]
Read-only
previousLeaf
DefaultMutableTreeNode
Read-only
previousNode
DefaultMutableTreeNode
Read-only
previousSibling
DefaultMutableTreeNode
Read-only
root
boolean
Read-only
siblingCount
int
Read-only
userObject
Object
Read-write
userObjectPath
Object[ ]
Read-only
 
Search WWH ::




Custom Search