Class DefaultTreeModel
java.lang.Object
javax.swing.tree.DefaultTreeModel
- All Implemented Interfaces:
Serializable
,TreeModel
A simple tree data model that uses TreeNodes.
For further information and examples that use DefaultTreeModel,
see How to Use Trees
in The Java Tutorial.
Warning:
Serialized objects of this class will not be compatible with
future Swing releases. The current serialization support is
appropriate for short term storage or RMI between applications running
the same version of Swing. As of 1.4, support for long term storage
of all JavaBeans
has been added to the java.beans
package.
Please see XMLEncoder
.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected boolean
Determines how theisLeaf
method figures out if a node is a leaf node.protected EventListenerList
Listeners.protected TreeNode
Root of the tree. -
Constructor Summary
ConstructorsConstructorDescriptionDefaultTreeModel
(TreeNode root) Creates a tree in which any node can have children.DefaultTreeModel
(TreeNode root, boolean asksAllowsChildren) Creates a tree specifying whether any node can have children, or whether only certain nodes can have children. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a listener for the TreeModelEvent posted after the tree changes.boolean
Tells how leaf nodes are determined.protected void
fireTreeNodesChanged
(Object source, Object[] path, int[] childIndices, Object[] children) Notifies all listeners that have registered interest for notification on this event type.protected void
fireTreeNodesInserted
(Object source, Object[] path, int[] childIndices,