From Zero to Productive in a Single Book
A nice glide through the simple issues, with a good exploration of critical concepts.
When Sun’s early versions of the Java Foundation Classes (JFC) first hit the web, Duke (the Java mascot) was at the park, swinging back and forth in anticipation. The code name Swing was so evocative and catchy that its likely to be associated with the JFC for a very long time. Getting up to speed with the JFC, is really a question of getting in the Swing of things. All puns aside, if you need to learn the JFC, get the lay of the land in a hurry and explore all concepts you need to make you productive, Up to Speed with Swing is probably what you’re looking for.
Divided into three parts, this is a book that takes a logical path through the Swing API. It sets a foundation in the early chapters with a look ahead, a quick Java refresher, and an introduction to the Model-View-Controller architecture in Part I. We then move on to explore each of the major component groups in Part II, and wrap things up with a look at advanced topics, like custom look and feels and JFC optimization, in Part III. Much of the optimization chapter is applicable to any Java code base, with a nice look at profilers and a great series of tips that’ll help you find bottlenecks in your code.
The Swing components inherit from the JComponent class, but the heavyweight JFrame and JApplet for the root of most applications. This is where part II begins. Chapter 3, covers borders, layout managers and the many panes available in the JFC. Tabbed panes, scrolling panes, split panes, layered panes and directory panes for the basis for many of the more interesting behaviors available to a JFC programmer. The author’s progression is fluid and intuitive, building the fundamentals up front, before introducing Swing’s more discrete components.
Chapter 4 takes a look at the label and various button classes, which share a number of attributes and basic commonality. The many text handling components are explored in Chapter 5. Chapter 6 groups the progress bar scroll bar and slider controls together. Chapter 7 covers the menus and toolbars, complete with check and radio menu items and popup menus. Dialog boxes and internal frames (akin to child windows in a multiple document interface) get addressed in Chapter 8, which also covers the color and file choosers. These chapters also touch on important concepts like implementing Actions and demonstrate a few clever tricks along the way.
The three most powerful and complex objects in Swing are covered in Chapters 9 to 11. Much of the groundwork is explored through the first, JList component, which implements the simplest model, rendering and editing facilities. By describing the concepts in this simplified context, the clarity of subsequent issues is greatly enhanced. When the reader gets to the JTree coverage in Chapter 10, the additional complexity seems much less daunting. The JTable coverage, which follows in Chapter 11, provides answers to questions not well addressed in many of the other JFC books, such as how to develop custom header rendering and make sense of the interrelationship between the large number of table classes.
Up to Speed with Swing delivers on a basic promise. It helps the reader go from a general understanding of Java, toward a good understanding of the Java Foundation Classes. If you are developing applications in Java that require a modern user interface, the Swing set provides the tools you really need. The author flows from the basics to sophisticated solutions, sprinkling insights and wisdom along the way, all of which can add to your programmer’s bag of tricks while the text leads you smoothly through your learning curve. All in all, a good investment for any Swing programmer.