Python Programming with the Java™ Class Libraries: A Tutorial for Building Web and Enterprise Applications with Jython
by Richard Hightower
JTree
Breaking things into hierarchies is natural. Think of your computer's file system, which employs drives, directories, subdirectories, folders, and files to keep things organized. With JTree we can create hierarchical organizations for any sort of graphical display.
The best way to describe JTree is as a cross between a list and an organizational chart. We're going to illustrate it first with a simple example and then with examples that increase in complexity (and thus become more realistic).
JTree's Constructor
There are several versions of the JTree constructor—one takes a hashtable as a parameter; others use vectors, tree models, tree nodes, and arrays. We're going to start off with the hashtable version and add some objects to it. Don't ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access