Chapter 11 Examples


 
JTree
SimpleTreeExample.java creates a tree from a Vector and displays it. Removed call to setFont on the tree, the default tree cell renderer does not handle the larger font correctly.
 
Tree Nodes
TreeNodeExample.java creates a tree using tree nodes and displays it. Removed call to setFont on the tree, the default tree cell renderer does not handle the larger font correctly.
 
Tree Model
FileSystemTreeModel.java defines a custom tree model. File holder objects defined in FileHolder.java are used to store information about each node. FileTree.java displays a file tree based on command line arguments.
 
Tree Selection Listener
TreeSelExample.java uses a TreeSelectionListener to receive notificaitons when the selection in a tree changes. Removed call to setFont on the tree, the default tree cell renderer does not handle the larger font correctly.
 
Multiple Tree Selections
TreeMSelExample.java uses a TreeSelectionListener to receive notificaitons when the selection in a tree changes. Multiple selections are supported.
 
Tree Expansion Listener
TreeExpExample.java uses a TreeExpansionListener to receive notificaitons when the nodes in a tree expand or collapse. Removed call to setFont on the tree, the default tree cell renderer does not handle the larger font correctly.
 
Tree Renderer
TreeIconRenderer.java defines a custom tree renderer. Data objects defined in TreeData.java are used to store information about each node. TreeRenderExample.java displays a tree using the custom renderer.
 
Tree Root Attributes
TreeRootExample.java displays two trees with different root attributes. Removed call to setFont on the tree, the default tree cell renderer does not handle the larger font correctly.
 
Editable Tree Model
FileSystemTreeModel.java defines an editable custom tree model that represents the file system. File holder objects are used to store information about each node. EditableFileTree.java displays a file tree based on command line arguments, the tree is marked editable. Removed call to setFont on the tree, the default tree cell renderer does not handle the larger font correctly.
 
Custom Tree Editor
TreeFieldEditor.java defines a tree editor. SimpleTreeRenderer.java defines a tree renderer that supports fonts and images. CustomEditorExample.java displays a tree with the custom editor and renderer.
 
Tree Mouse Listener
TreeClickExample.java uses a MouseListener to receive notificaitons when a tree node is double clicked. Removed call to setFont on the tree, the default tree cell renderer does not handle the larger font correctly.


Copyright � 1998, John Wiley and Sons, Inc.