Java Swing by Robert Eckstein, Marc Loy, and Dave Wood Here are the changes that were made in the December 1998 reprint: Global changes: The following package names were changed throughout the book in both text and figures: com.sun.java.swing changed to javax.swing com.sun.java.accessibility changed to javax.accessibility with these exceptions: com.sun.java.swing.plaf.windows com.sun.java.swing.plaf.motif com.sun.java.swing.accessibility.util (The exceptions only appear in Chapters 25 and 26.) For example, com.sun.java.swing.JButton became javax.swing.JButton com.sun.java.swing.text.Document became javax.swing.text.Document com.sun.java.swing.plaf.basic.BasicLookAndFeel became javax.swing.plaf.basic.BasicLookAndFeel. but com.sun.java.swing.plaf.motif.MotifLookAndFeel was not changed. (See also the "Updates for Swing 1.1 Beta 3" link from the book's Web page, http://www.oreilly.com/catalog/jswing.) Specfic changes: [xxiii] paragraph 3: Replace with: One significant problem we've faced is Sun's waffling on the Swing package names. Swing was first released in the com.sun.java.swing package hierarchy, which was supposed to be a temporary resting place. With JDK 1.2, Swing was supposed to move into the java.awt.swing hierarchy. For some reason, Sun backed off, and kept Swing in the com.sun hierarchy for beta 4. They then moved it to javax.swing for the first official release of JDK 1.2--except for a few oddball platform-specific packages (like the Windows look-and-feel) that remain in com.sun. We've been at our wit's end trying to fix the package names, both in the book and in the online source files. At any rate, for JDK 1.2 and Swing 1.1 (for use with JDK 1.1), the major Swing classes are in the following packages: add this footnote at the end of the 3rd paragraph, after all the other changes: "The latest rumor is that Sun will rechristen JDK 1.2 when the final official release occurs--it will probably be called Java 2." para 2 (description for com.sun.java.swing.plaf--which, according to the new rules, will become javax.swing.plaf): replace with: "Classes supporting "pluggable look-and-feel", including classes that implement the Metal and Multi look-and-feels. (Implementations of the Windows and Motif L&Fs are packaged under com.sun.java.swing.plaf.) Covered in Chapter 26, Look & Feel." About the Source Code: Add at the end of the section: "The examples are available as a JAR file, a ZIP archive, and as a compressed TAR archive. The files named swing-old use the old (com.sun) package hierarchy, and have been tested against JDK 1.2 beta 4. The files named swing have been converted to the new (javax) package hierarchy, and have been tested against JDK 1.2 Release Candidate 1." (6) In the note, the last phrase should be "parts of which only work on the Windows platform." (7) para. 2 add "several" to read "Swing is capable of emulating several look-and-feels, ..." {11} paragraph describing com.sun.java.accessibility (which will become javax.accessibility): Delete sentence beginning "In addition, you can also..." <11> Delete sentence "The package names may change to javax.swing in the future." {11} modify footnote: replace "and now has...the actual release" with "and is using the javax.swing hierarchy for the actual release of JDK 1.2." Also to the footnote on page 11, after all the other changes are made, add "Sun provides a free tool for automatically adjusting the package names in any code you've written for earlier releases. For more information, see http://java.sun.com/products/jfc/PackageRenamer/. <12> last sentence under javax.swing.plaf: Modify the sentence to read: "Concrete implementations of the windows and motif L&Fs are in subpackages of com.sun.java.swing.plaf." (This is the exception to the rule.) <12> para. 4 (description of com.sun.java.swing.plaf): Add to the end: "(Concrete implementations of the Windows and Motif L&Fs are in subpackages of com.sun.java.swing.plaf.)" [12] para. 5 (description of com.sun.java.swing.preview): Delete. (19) para. 3, "To see why, romember...": "romember" changed to "remember" <20> before "after downloading" add: "Assuming you're using JDK 1.1..." Also, before "you should immediately", add: "If you're using JDK 1.2, just find the directory demo/SwingSet (unfortunately, it's moved around in different pre-releases) and type java SwingSet." (40) in the code: indent line 10 ("implements...") two spaces. {169} model = new DefaultListModel (); list = new JList (); should read: model = new DefaultListModel (); list = new JList (model); <247> end of the first paragraph, add a footnote: "The appearance of an internal frame in the Metal look-and-feel has changed very slightly since these screen shots were taken." (Use same footnote for p. 561) [510] The code // Now we must rebuild the headers array with the new column names headers = new String[ colCount ]; for( int i = 1; h <= colCount; h++ ) { headers[ h ] = meta.getColumnName( h ); } Arrays start at 0 therefore the line 'headers[ h ] = meta.getColumnName( h )' should be // Now we must rebuild the headers array with the new column names headers = new String[ colCount ]; for( int i = 1; h <= colCount; h++ ) { headers[ h-1 ] = meta.getColumnName( h ); ^^ } (722) bottom of Table 19-7: Delete dot before JTextComponent. (714) 2nd to last paragraph; last sentence should read: "...subclass JTextArea and override isManagingFocus() to return false." This instead of "getManagingFocus()" {943} add footnote after "HTML package has stabalized.": "As of JDK 1.2 beta4, HTMLEditorKit looks more stable, but we're still not convinced it's cooked." (HTMLEditorKit is constant width) (995) Put the "u" in "updateWindow(comp);" under the "t" in "timer". (1004) 1st sentence: Add footnote after "package": "Note that the Windows and Motif look-and-feels remain in the com.sun.java.swing.plaf package hierarchy." (1014) code, line 4: indent this line so that the "c" in com.sun is under the "M" in UIManager. (Note that in this case, com.sun.java.swing.plaf.motif does NOT change.) {1017} para. 1: eliminate "beta 4" from the directory names; i.e., "/usr/local/jdk1.2/" and "/usr/local/jdk1.2/jre/lib/swing.properties". (1080) Table 27-6: Add a line under the table header. (1136) End of first paragraph - the closing parenthesis was deleted. {1100} Bottommost source code excerpt, 5th line of code should be: if (list[index]==ChangeListener.class) { Also, the index was updated to reflect the new package names entered in the reprint. The new index is available via the "Index" link from the book's Web page, http://www.oreilly.com/catalog/jswing.