TreeNode
DefaultMutableTreeNode
, JTree.DynamicUtilTreeNode
public interface MutableTreeNode extends TreeNode
Modifier and Type | Method | Description |
---|---|---|
void |
insert |
Adds child to the receiver at index . |
void |
remove |
Removes the child at index from the receiver. |
void |
remove |
Removes node from the receiver. |
void |
removeFromParent() |
Removes the receiver from its parent. |
void |
setParent |
Sets the parent of the receiver to newParent . |
void |
setUserObject |
Resets the user object of the receiver to object . |
children, getAllowsChildren, getChildAt, getChildCount, getIndex, getParent, isLeaf
void insert(MutableTreeNode child, int index)
child
to the receiver at index
. child
will be messaged with setParent
.child
- node to be addedindex
- index of the receivervoid remove(int index)
index
from the receiver.index
- index of child to be removedvoid remove(MutableTreeNode node)
node
from the receiver. setParent
will be messaged on node
.node
- node to be removed from the receivervoid setUserObject(Object object)
object
.object
- object to be set as a receivervoid removeFromParent()
void setParent(MutableTreeNode newParent)
newParent
.newParent
- node to be set as parent of the receiver
© 1993, 2023, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
https://docs.oracle.com/en/java/javase/21/docs/api/java.desktop/javax/swing/tree/MutableTreeNode.html