Optimize with a SATA RAID Storage Solution
Range of capacities as low as $1250 per TB. Ideal if you currently rely on servers/disks/JBODs
Why does JFC, and more specifically Swing, overshadow all other Java APIs? Because 99.9 percent of modern applications require rich GUI front ends. Whatever application domain you specialize in, we all need to clothe our applications in modern graphical user interfaces. This GUI facade doesn't only make or break modern applications, it also severely impacts your software development efforts. Huge chunks of your (and my) code are there purely and simply for the sake of user friendliness, and have nothing to do with core product functionality. GUIs are really the software equivalent of automatic transmissions, vanity mirrors, central locking, and adjustable seats in cars. That is, the essential non-essentials without which you don't sell products.
GUI capability was the sole reason for the often-criticized AWT's original raison d'etre. Unfortunately, AWT's multitude of flaws and imperfections have led many to feel that Java's original GUI capability is just another Java Achilles heel (performance being the first). Thankfully, JavaSoft seems quite adept at quickly and skillfully addressing Java aspects that fall below expectations (possibly excluding politically too-hot-to-handle issues like its unpopular Collections API), so we now have Java Foundation Classes (JFC) to relegate AWT to the history books.
If you're a regular visitor to Sun's Java Developer Connection (JDC) discussion groups, you know that the volume of GUI questions is at least an order of magnitude greater than for some other "hot" Java APIs. In light of this, I decided it was time JavaWorld took a closer look at books that aim to flatten the JFC/Swing learning curve, and bulldoze AWT from the Java map in the process. This month I'm reviewing four quick-off-the-mark JFC books (and, as always, taking my dope-test kit along.)
At the time of writing, four books were available that include the words Java Foundation Classes, JFC, or Swing in their titles:
Note: Core Java Foundation Classes by Kim Topley, Cay S. Horstmann, and Gary Cornell (ISBN: 0130803014) was not available for review at press time.
Here's a bird's-eye view of each title's main attributes. The table orders the books by price.
| Up to Speed with Swing (Manning) | JFC: Java Foundation Classes (IDG Books) | Java Foundation Classes (McGraw-Hill) | Programming with JFC (John Wiley) |
| Price (US$) | 2.95 | 9.99 | 9.95 | 9.99 |
| Pages, chapters (appendices) | 498, 13 (4) | 541, 11 (3) | 1040, 13 (0) | 560, 19 (2) |
| Index | Average | Good | Good | Average |
| Glossary | No | No | No | No |
| CD-ROM | No | Yes | Yes | Yes |
| Authors | 1 | 2 | 1 | 2 |
| Listings density (lines/page) | 48 | 44 | 54 | 45 |
| MVC framework | Yes | Yes | No | No |
| Pluggable look-and-feel framework | Yes | No | Yes | Yes |
| Document framework | Yes | No | Yes | Yes |
| Undo/redo framework | No | Yes | No | Yes |
| Drag-and-drop framework | No | Yes | Yes | No |
| Printing framework | No | Yes | Yes (*) | No |
| Accessibility framework | No | Yes | Yes | Yes (*) |
| Java2D | No | Yes (*) | Yes | No |
| No. of "real-life" examples | None | 4 | 4 | 2 |
| Overall score | 7 | 7 | 6 | 7 |
*Strictly speaking, yes, but only touched upon.
In the absence of tools to calculate the true cost-per-bit equivalent of a book, the Listings density row gives you an idea of how dense or "aerated" the source listings are. Low lines and/or page values usually mean unreadable listings and a high page-fill factor, so the higher this value, the better (up to some limit determined by your own eyesight, of course).
The MVC framework row indicates whether or not the text explains Swing's underlying Model-View-Controller design pattern.
The Pluggable look-and-feel framework row indicates whether or not the text explains and demonstrates Swing's pluggable look and feel (PLAF).
The Document framework row indicates whether or not the text attacks the nontrivial subject of Swing's Text Document framework (that is, package com.sun.java.swing.text and its subpackages).
The Accessibility framework row indicates whether or not the text explains Swing's accessibility support for people with disabilities.
The Drag-and-drop framework row indicates whether or not the text discusses JFC's drag-and-drop support, as provided by the classes and interfaces in the java.awt.dnd package.
The Undo/redo framework row indicates whether or not the text discusses JFC's undo/redo support as provided by the classes and interfaces in the com.sun.java.swing.undo package.
The Java2D row indicates whether or not the text explores JFC's Java2D API. Most texts don't, since Java2D is most definitely a subject worthy of its own book(s). Any JFC books reviewed here that do write about Java2D do so only superficially.
The No. of "real-life" examples row indicates how many mini-projects are presented that begin to approach a real-life project.
While the first part of this book's title is spot-on accurate, the second part isn't. Up to Speed with Swing is all about Swing's GUI component classes, and very little, if at all, about any of the other JFC APIs (see comparative table). Despite this little titling error (which publishers seem to make more and more often, and which always seems to broaden the scope of a book), the book's content does deliver on its title's core promise.
The book is subdivided into three parts: Part I, "Getting started;" Part II, "Swing components;" and Part III, "Advanced topics."
Chapter 1, "A Java refresher," is really an AWT (and not Java) refresher that concentrates on event handling and layout managers,
two aspects that have remained unchanged from AWT to Swing. Chapter 2, "Swing basics," therefore, is the beginning of the
real meat on this particular bone. After an overview of the Swing packages, the author delves into the Model-View-Controller
(MVC) design pattern, the architectural foundation for everything Swing -- especially its pluggable look and feel, custom
rendering, and custom model capabilities. The chapter closes with a thorough "open-top bus tour" of class JComponent, the abstract grandaddy of all Swing GUI components.