Java javax.swing.tree DefaultTreeModel fields, constructors, methods, implement or subclass

Example usage for Java javax.swing.tree DefaultTreeModel fields, constructors, methods, implement or subclass

Introduction

In this page you can find the methods, fields and constructors for javax.swing.tree DefaultTreeModel.

The text is from its open source code.

Subclass

javax.swing.tree.DefaultTreeModel has subclasses.
Click this link to see all its subclasses.

Constructor

DefaultTreeModel(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

voidaddTreeModelListener(TreeModelListener l)
Adds a listener for the TreeModelEvent posted after the tree changes.
ObjectgetChild(Object parent, int index)
Returns the child of parent at index index in the parent's child array.
intgetChildCount(Object parent)
Returns the number of children of parent.
TreeNode[]getPathToRoot(TreeNode aNode)
Builds the parents of node up to and including the root node, where the original node is the last element in the returned array.
ObjectgetRoot()
Returns the root of the tree.
voidinsertNodeInto(MutableTreeNode newChild, MutableTreeNode parent, int index)
Invoked this to insert newChild at location index in parents children.
voidnodeChanged(TreeNode node)
Invoke this method after you've changed how node is to be represented in the tree.
voidnodeStructureChanged(TreeNode node)
Invoke this method if you've totally changed the children of node and its children's children...
voidnodesWereInserted(TreeNode node, int[] childIndices)
Invoke this method after you've inserted some TreeNodes into node.
voidreload()
Invoke this method if you've modified the TreeNode s upon which this model depends.
voidreload(TreeNode node)
Invoke this method if you've modified the TreeNode s upon which this model depends.
voidremoveNodeFromParent(MutableTreeNode node)
Message this to remove node from its parent.
voidsetRoot(TreeNode root)
Sets the root to root.