-
- All Superinterfaces:
- TreeNode
- All Known Implementing Classes:
- DefaultMutableTreeNode, JTree.DynamicUtilTreeNode
public interface MutableTreeNode extends TreeNode
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.- See Also:
DefaultMutableTreeNode
,JTree
-
-
Method Summary
Methods Modifier and Type Method and Description void
insert(MutableTreeNode child, int index)
Addschild
to the receiver atindex
.void
remove(int index)
Removes the child atindex
from the receiver.void
remove(MutableTreeNode node)
Removesnode
from the receiver.void
removeFromParent()
Removes the receiver from its parent.void
setParent(MutableTreeNode newParent)
Sets the parent of the receiver tonewParent
.void
setUserObject(Object object)
Resets the user object of the receiver toobject
.-
Methods inherited from interface javax.swing.tree.TreeNode
children, getAllowsChildren, getChildAt, getChildCount, getIndex, getParent, isLeaf
-
-
-
-
Method Detail
-
insert
void insert(MutableTreeNode child, int index)
Addschild
to the receiver atindex
.child
will be messaged withsetParent
.
-
remove
void remove(int index)
Removes the child atindex
from the receiver.
-
remove
void remove(MutableTreeNode node)
Removesnode
from the receiver.setParent
will be messaged onnode
.
-
setUserObject
void setUserObject(Object object)
Resets the user object of the receiver toobject
.
-
removeFromParent
void removeFromParent()
Removes the receiver from its parent.
-
setParent
void setParent(MutableTreeNode newParent)
Sets the parent of the receiver tonewParent
.
-
-
Document created the 11/06/2005, last modified the 04/03/2020
Source of the printed document:https://www.gaudry.be/en/java-api-rf-javax/swing/tree/mutabletreenode.html
The infobrol is a personal site whose content is my sole responsibility. The text is available under CreativeCommons license (BY-NC-SA). More info on the terms of use and the author.
References
These references and links indicate documents consulted during the writing of this page, or which may provide additional information, but the authors of these sources can not be held responsible for the content of this page.
The author This site is solely responsible for the way in which the various concepts, and the freedoms that are taken with the reference works, are presented here. Remember that you must cross multiple source information to reduce the risk of errors.