Category: Trees in Swing

Trees in Swing

The JTree Class

The JTree Class

Now that you’ve seen all the tree models and some of the default implementations, let’s look at the visual representation we can give them. The JTree class can build up trees out of several...

A Simple Tree

A Simple Tree

This example works by building up a series of unconnected nodes (using the DefaultMutableTreeNode class) and then connecting them. As long as we stick to the default classes provided with the tree package, we...