Welcome to the OO Design & Patterns FAQ!
Question: What is the difference between the first and
Answer: The second edition is updated for Java 5.0. Where
appropriate, the text and code examples are rewritten to take advantage
of the following features:
Chapter 7 has a section on generic types and wildcards.
- The "for each" loop
- Variable arguments
- Typesafe enumerations
- Swing simplifications (no getContentPane, super.paintComponent)
The treatment of JavaBeans in Chapter 7 has been simplified.
Chapter 9 introduces Lock and Condition objects
before explaining the complex behavior of the built-in locks.
Otherwise, the content has not changed.
Question: Why did you change the bridge on the cover?
Answer: The Zakim bridge
is surely a fine bridge, and it was the favorite of Paul Crockett, my
former editor. However, when Paul left Wiley, I jumped at the chance of
substituting my favorite, the Golden Gate bridge. Of
course I am biased; I live 5 minutes away, in the beautiful San Francisco Presidio.
Question: What happened to super.paintComponent? Answer: If you extend a JPanel, you must call super.paintComponent in the paintComponent implementation of the subclass. In Swing terminology, a panel is "opaque", and it must paint its entire surface. However, a JComponent is transparent by default, and it will erase the background before invoking the paintComponent method.
Also see the First Edition FAQ