Jtree also lets you edit data about the nodes, add new nodes and prune. You use the TreeModel interface implemented by DefaultTreeModel to manage your tree data. You change the tree by poking the TreeModel, not by poking the TreeNodes directly. You can also use TreeNodes independent of a display, though most algorithmic tree handling is done with specialised classes.
Note that it is spelled JTree not Jtree
| JTree Classes | |
|---|---|
| Class | Purpose |
| JTree | master GUI component |
| DefaultTreeModel | used this code as a base to hold all your tree data. |
| TreeNode | Interface to write code for a node if the user may not modify. |
| MutableTreeNode | Inteface to write code for a node the user can modify either by adding or removing children or by changing the value associated with the node. Normally use DefaultMutableTreeNode. |
| DefaultMutableTreeNode | use this code as a base to hold data for one node of your TreeModel |
| TreePath | represents a hierarchical chain through the tree. |
| TreeCellRenderer | Interface for your code to display a node. |
| DefaultTreeCellRenderer | using this code as a base to write your own cell renderer. |
| TreeCellEditor | Interface for your code to allow user to edit a node. |
| DefaultTreeCellEditor | using this code as a base to write your own cell editor. |
| TreeSelectionListener | interface to write your own code to respond to user selecting/deselecting a node. |
|
|
You can get the freshest copy of this page from: | or possibly from your local J: drive (Java virtual drive/mindprod.com website mirror) |
| http://mindprod.com/jgloss/jtree.html | J:\mindprod\jgloss\jtree.html | |
![]() | Please email your feedback for publication,
letters to the editor, errors, omissions, typos, formatting errors, ambiguities, unclear wording,
broken/redirected link reports, suggestions to improve this page or comments to
Roedy Green :
| |
| Canadian Mind Products | ||
| mindprod.com IP:[65.110.21.43] | ||
| view Blog | Your face IP:[38.107.179.211] | |
| Feedback | You are visitor number 18,130. | |