Java Reference
In-Depth Information
filesystem tree familiar to many PC users, the JTree allows you to view multi-
ple levels at once and to open and close nodes, exposing or hiding their subtrees.
It would make more sense to use the JTree in our example, but then we
wouldn't have been able to describe all the ins and outs of the JTable , a class
that is so useful in so many applications.
There are many more Swing classes that we haven't discussed, though
many will behave similarly to those you have seen here. There are topics that
we have avoided—for example, we haven't talked about sorting JTable s by
clicking on the column headings, or about TableColumnModel s which add
another layer to JTable s. Some of what you would need to know in order to
use these Swing classes you can glean from the Javadoc pages. The information
there should make more sense now, based on your experience with the various
Swing mechanisms that you've seen in these pages. For some other Swing topics
you will have to search farther, and there are plenty of topics on the topic—the
classic one, the The JFC Swing Tutorial from Sun, being over 900 pages long.
Is it any wonder that we didn't cover it all in this chapter?
16.10
R ESOURCES
The JFC Swing Tutorial: A Guide to Constructing GUIs by Kathy Walrath
and Mary Campione, Addison-Wesley, also available online at
http://java.sun.com/docs/books/tutorial/uiswing/index.html .
• Our favorite bookmark within the Swing tutorial, the visual index of the
various Swing components, is at http://java.sun.com/docs/books/
tutorial/uiswing/components/components.html .
• If you want a better understanding of layout managers, we recommend
this tutorial by Jan Newmarch at Monash University in Australia:
http://pandonia.canberra.edu.au/java/xadvisor/geometry/
geometry.html . Don't let the mention of AWT scare you away. Almost
all of the layout managers (except BoxLayout and SpringLayout ) are
actually from AWT, and they all apply to Swing.
16.11
E XERCISES
1. Use different layout managers to create of the status area of the BudgetPro
main window, laying out the status information differently. Make the
Search WWH ::




Custom Search