Swing Data Model Case Study
This chapter presents an example of a Swing component which uses a complex data model. In this case we will examine the JTree swing component, which requires a data model which represents the tree being displayed. The JTree component renders the tree data model; thus if the data model changes, the tree rendered by JTree also changes. To illustrate these ideas we will construct a simple application which displays all the classes inherited by a specified class. Note that a second Swing package will be used: javax.swing.table. ⋆.
Unable to display preview. Download preview PDF.
- The Swing Connection: http://java.sun.com/products/jfc/swingdoc-current/doc/index.html.
- The Java Tutorial: Using the JFC “Swing” Release: http://java.sun.com/docs/books/tutorial/post1.0/ui/swing.html.
- (see section entitled “How to Use Trees”). The JFC Home Page: http://java.sun.com/products/jfc/index.html.