13.07.2015 Views

Java™ Application Development on Linux - Dator

Java™ Application Development on Linux - Dator

Java™ Application Development on Linux - Dator

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

16.11 Exercises375filesystem tree familiar to many PC users, the JTree allows you to view multiplelevels at <strong>on</strong>ce 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 wewouldn’t have been able to describe all the ins and outs of the JTable, a classthat is so useful in so many applicati<strong>on</strong>s.There are many more Swing classes that we haven’t discussed, thoughmany will behave similarly to those you have seen here. There are topics thatwe have avoided—for example, we haven’t talked about sorting JTables byclicking <strong>on</strong> the column headings, or about TableColumnModels which addanother layer to JTables. Some of what you would need to know in order touse these Swing classes you can glean from the Javadoc pages. The informati<strong>on</strong>there should make more sense now, based <strong>on</strong> your experience with the variousSwing mechanisms that you’ve seen in these pages. For some other Swing topicsyou will have to search farther, and there are plenty of books <strong>on</strong> the topic—theclassic <strong>on</strong>e, the The JFC Swing Tutorial from Sun, being over 900 pages l<strong>on</strong>g.Is it any w<strong>on</strong>der that we didn’t cover it all in this chapter?16.10RESOURCES• The JFC Swing Tutorial: A Guide to C<strong>on</strong>structing GUIs by Kathy Walrathand Mary Campi<strong>on</strong>e, Addis<strong>on</strong>-Wesley, also available <strong>on</strong>line athttp://java.sun.com/docs/books/tutorial/uiswing/index.html.• Our favorite bookmark within the Swing tutorial, the visual index of thevarious Swing comp<strong>on</strong>ents, is at http://java.sun.com/docs/books/tutorial/uiswing/comp<strong>on</strong>ents/comp<strong>on</strong>ents.html.• If you want a better understanding of layout managers, we recommendthis tutorial by Jan Newmarch at M<strong>on</strong>ash University in Australia:http://pand<strong>on</strong>ia.canberra.edu.au/java/xadvisor/geometry/geometry.html. D<strong>on</strong>’t let the menti<strong>on</strong> of AWT scare you away. Almostall of the layout managers (except BoxLayout and SpringLayout) areactually from AWT, and they all apply to Swing.16.11EXERCISES1. Use different layout managers to create of the status area of the BudgetPromain window, laying out the status informati<strong>on</strong> differently. Make the

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!