Section 16.9. What You Still Don t Know


16.9. What You Still Don't Know

One could spend a career learning the vagaries of layout managers, especially the way they interact (e.g., a BoxLayout inside the various regions of a BorderLayout). There is still an art to getting all the interactions right; it's often quickest to prototype the layout before you get too committed to a particular layout. Also, putting objects into containers can help you subdivide the layout problem into more manageable pieces. You can even go so far as to write your own LayoutManager, a topic we do not cover in this book.

The information that we display in the JTable in our example is hierarchical. Swing provides a Jtree object for displaying such information. Like a filesystem tree familiar to many PC users, the Jtree allows you to view multiple 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 avoidedfor example, we haven't talked about sorting JTables by clicking on the column headings, or about TableColumnModels which add another layer to JTables. 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 books on the topicthe 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?



    Java Application Development with Linux
    Java Application Development on Linux
    ISBN: 013143697X
    EAN: 2147483647
    Year: 2004
    Pages: 292

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net