More About Swing Components

Components and events named all the significant JComponents, and there were about forty in all (including all the subclasses of subclasses). We've briefly presented some of the more important ones here. That's certainly enough to get you started writing GUI programs. To keep the book to a manageable size, however, and still fit in all the other information, we don't show all of them.

Here are some pointers on how to find out more about the other components when you're ready to. The first resource is the good (if somewhat fluid) online tutorial on Java in general, and Swing in particular, that Sun Microsystems maintains at java.sun.com/docs/books/tutorial/ui/swing/.

The second resource is a book that examines JFC, including the Swing components in depth. These books are frequently intimidating in size. One such book that I like is The JFC Swing Tutorial: A Guide to Constructing GUIs, Second Edition by Walrath, Campione, Huml, and Zakhour (Addison-Wesley, 2004, ISBN 0201914670). It weighs in at 800 pages, so be prepared to put in a few evenings and weekends.

Finally, I have the same advice that Obi-Wan gave Luke Skywalker on his quest to defeat the forces of evil: Use the Source. The Java platform is almost unique among commercial products in that the complete source code for the run-time library is distributed with the system.

Having the source is a triple blessing. You can read the code to find out how something works and what features it offers (the code is heavily commented). You can recompile the code with more of your own debugging information, and use that instead of the standard run-time library (not everyone will want to tackle this, but in fact, it is trivial to use the “update” option to jar to replace a single class file in rt.jar. Make a backup copy of rt.jar before you change anything, and don't tell anyone you heard this idea from me). You will also be exposed to the ideas, style, and designs that are used by the best Java programmers in the world. The best programmers in the world learn from each other by reading each other's code. Now you have this opportunity, too. Seize it.

I really like Swing. It passes the golden rule of software: it's simple to do simple things. Just be aware that all the components have many more features than are presented here and you can get sophisticated effects when you start combining them and using them to full advantage.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.217.150.123