Top Description Methods
javax.swing.tree

public Interface MutableTreeNode

extends TreeNode
Known Direct Implementers
javax.swing.tree.DefaultMutableTreeNode

Defines the requirements for a tree node object that can change -- by adding or removing child nodes, or by changing the contents of a user object stored in the node.
Authors
Rob Davis, Scott Violet
See Also
DefaultMutableTreeNode, javax.swing.JTree

Method Summary

Modifier and TypeMethod and Description
public void
insert(MutableTreeNode
node to be added
child
,
int
index of the receiver
index
)

Adds child to the receiver at index.

public void
remove(int
index of child to be removed
index
)

Removes the child at index from the receiver.

public void
remove(MutableTreeNode
node to be removed from the receiver
node
)

Removes node from the receiver.

public void
removeFromParent()

Removes the receiver from its parent.

public void
setParent(MutableTreeNode
node to be set as parent of the receiver
newParent
)

Sets the parent of the receiver to newParent.

public void
setUserObject(Object
object to be set as a receiver
object
)

Resets the user object of the receiver to object.

Inherited from javax.swing.tree.TreeNode:
childrengetAllowsChildrengetChildAtgetChildCountgetIndexgetParentisLeaf

Method Detail

insertback to summary
public void insert(MutableTreeNode child, int index)

Adds child to the receiver at index. child will be messaged with setParent.

Parameters
child:MutableTreeNode

node to be added

index:int

index of the receiver

removeback to summary
public void remove(int index)

Removes the child at index from the receiver.

Parameters
index:int

index of child to be removed

removeback to summary
public void remove(MutableTreeNode node)

Removes node from the receiver. setParent will be messaged on node.

Parameters
node:MutableTreeNode

node to be removed from the receiver

removeFromParentback to summary
public void removeFromParent()

Removes the receiver from its parent.

setParentback to summary
public void setParent(MutableTreeNode newParent)

Sets the parent of the receiver to newParent.

Parameters
newParent:MutableTreeNode

node to be set as parent of the receiver

setUserObjectback to summary
public void setUserObject(Object object)

Resets the user object of the receiver to object.

Parameters
object:Object

object to be set as a receiver