Stories
Slash Boxes
Comments

News for nerds, stuff that matters

The JFC Swing Tutorial

Posted by Hemos on Sun Nov 07, 1999 09:06 AM
from the learning-the-new-ropes dept.
Long-time reviewer Jason Bennett has sent a review of the official Sun tutorial on the new Swing GUI package called, not surprisingly, The JFC Swing Tutorial. If you are learning Java, use Java or want to learn Java, click below to learn more about this new book.
JFC Swing Tutorial
author Kathy Walrath & Mary Campione
pages 953
publisher Addison Wesley, 06/1999
rating 8/10
reviewer Jason Bennett
ISBN 0201433214
summary The official Sun tutorial on the new Swing GUI package

Background

I was just finishing up my first year of university when Java burst onto the scene. As those of us who were around then can remember, the hype was intense. Actually, that would be an understatement. You would have thought Java was going to save the world and make your morning coffee all at once. Fortunately, things settled down almost as fast as they began, and Java started on its long road to maturity. In many ways, this book is the culmination of three years of Java maturation. The AWT, Java's original GUI library, has been replaced by a completely new one, Swing, with the release of Java 1.2/2.0. It promises to have more features, be more stable, and generally live up to the platform-specific libraries against which it competes. In many ways, Swing is the hope for Java on the desktop. Of course, you have to figure out all those APIs first....

What's the book about?

The JFC Swing Tutorial is the Sun-imprinted official word on how to code for the Swing API (note that this book is also available for free from Sun's web site [see the link in the title above]). Of it's 950 pages, literally the last 300 are source code to all of the examples in the text, while the first 600 delve into every aspect of Swing. As with most tutorials, things start off slow, with a "hello, world!" equivalent, but the difficulty ramps up quickly. There is a (relatively) short section giving an introduction to layouts, painting, and other GUI basics before the real meat of the book begins.

Chapters 12-17 are the heart of the tutorial, and take the reader through every part of the Swing API. This is broken up into top-level containers (frames, dialogs, applets), intermediate-level containers (panels, panes, tool bars), and atomic components (all the buttons, choosers, and menus). There are tables at the end of each section summarizing the various methods, along with their purposes. There are also example summaries, listing where to find the examples that demonstrate the various concepts presented. The section is quite thorough, with plenty of code interspersed through the text.

The final part delves into the other parts of Swing, including layouts, actions, borders, icons, look and feel, and chapters on event listeners, graphics, and converting from the AWT. These chapters continue the structure begun in the middle sections, with many code examples and handy summary tables.

What's Good?

Simply put, if you want to know how to do something in Swing, it's probably covered in this book to one extent or another. In fact, you're likely to find that your code has already been written for you to some extent, given the copious examples provided. Even if you cannot find exactly what you want, you can likely piece it together from what is provided. It's also nice being the official tutorial, as you can trust that the authors had decent references whenever they had a question or two. This is the official way to do Swing.

What's Bad?

Well, in short, more than I would like. Personally, I'm not well-grounded in doing GUIs. Not to say that I've never done them before, but I've had my struggles in the past. That's one reason I wanted to review this book, as I was hoping to strengthen my skills along the way. Unfortunately, I don't feel like that has happened. Don't misread the title. This isn't a GUI tutorial in any sense of the word; it's a Swing tutorial. The complexity of the text ramps up quite quickly after "hello, world," and if you aren't ready, you'll be lost in the dust. To be honest, I found this to be more of a reference book than a tutorial, at least to the extent that I wouldn't read this book cover-to-cover, but would pull it off the shelf any time I had a Swing question. The examples are thorough and there are plenty of them, but the style and layout do not make for an easy read-through.

So What's In It For Me?

Firstly, you have an amazing advantage of being able to try this book out for free. If you're interested, check out the URL and read through a few sections. Make your own review. You can buy it or ditch it at your leisure. Second, don't use this book as a general GUI tutorial. That's not what it is, and trying to use it as such will only frustrate you. If, however, you know GUIs, and you want to learn about all that Swing has to offer, this is an excellent book. You get an entire CD-ROM full of Java code for your use, plus the official Swing reference. Depending on your needs, this book will either be very helpful, or a very heavy paperweight.

Purchase this book at fatbrain.

  • Table of Contents
  • Preface
  • Before You Start
  • Getting Started with Swing
    1. About the JFC and Swing
    2. Compiling and Running Swing Programs
    3. Running Swing Applets
    4. A Quick Tour of a Swing Application's Code
  • Features and Concepts
    1. Components and Containment Hierarchies
    2. Layout Management
    3. Event Handling
    4. Painting
    5. Threads and Swing
    6. More Swing Features and Concepts
    7. The Anatomy of a Swing-Based Program
  • Using Swing Components
    1. A Visual Index to Swing Components
    2. The JComponent Class
    3. Using Top-Level Containers
    4. Using Intermediate Swing Containers
    5. Using Atomic Components
    6. Solving Common Component Problems
  • Laying Out Components
    1. Using Layout Managers
    2. Creating a Custom Layout Manager
    3. Doing Without a Layout Manager
    4. Solving Common Layout Problems
  • Using Other Swing Features
  • Writing Event Listeners
    1. Some Simple Event-Handling Examples
    2. General Rules for Writing Event Listeners
    3. Listeners Supported by Swing Components
    4. Implementing Listeners for Commonly Handled Events
    5. Summary of Listener API
    6. Solving Common Event-Handling Problems
  • Working with Graphics
    1. Overview of Custom Painting
    2. Using Graphics Primitives
    3. Using Images
    4. Performing Animation
    5. Solving Common Graphics Problems
  • Converting to Swing
    1. Why to Convert
    2. How to Convert
    3. Conversion Resources
    4. Solving Common Conversion Problems
  • Appendices
    1. Code Examples
    2. Reference
  • Index
This discussion has been archived. No new comments can be posted.
The JFC Swing Tutorial | Log In/Create an Account | Top | 92 comments (Spill at 50!) | Index Only | Search Discussion
Display Options Threshold:
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.