JBuilder Java Bible – Errata

A list of corrections for The JBuilder Java Bible — a book that taught Java programming, using the JBuilder development environment. (For the CD-software that accompanied the book, see The JBuilder Java Bible CD.)

About the Book

The book was a designed as a combination tutorial and reference manual for the Java programming language, using the JBuilder development environment as a vehicle for doing so. (The original intent was to use it as template, re-creating the same book in different development environments.)

The initial editions were published as “The JBuilder 2 Bible”, after the version of development environment (JBuilder 2). Despite many pleas, the publisher could not be dissuaded from doing so. As a result, the book got 5-stars as the Java programming tutorial for it was designed to be, but was given 1-star reviews by expert developers who were expecting intricate details about JBuilder.

Apparently, the documentation that accompanied the IDE was so meager that expert developers were searching for something better so they bought up the book in droves — at least at first. As the old saying goes, good marketing is the quickest way to kill a bad product, and for their purposes, the book was decidedly bad!. So initial purchasers in those categories posted exceedingly low reviews, which pulled down the stellar reviews from the audience the book was designed for.

The book was subsequently renamed “The JBuilder Java Bible”, but too late. The damage was done. The result was an average 3-star review — and a book that went nowhere. However, if you want to learn the Java programming language, and you have access to JBuilder, you could do far worse than use this book.

The remainder of this page lists corrections that would have gone into the 2nd edition, had the book done well enough to warrant one.

Missing Quotation Marks in the First Printing of the Book

Unfortunately, a great many quotation marks were dropped in the publishing process, which put much of the code in error. Here are places where they belong:

p. 70:

  • The two code lines at the bottom of the page: "This is your string."

p. 71:

  • The bold lines: "Hello World"

p. 90:

  • At the bottom of the page: "Buffy"

p. 94:

  • The two code lines at the top of the page: "George"

p. 95:

  • The two code lines at the top of the page: "George"

p. 196:

  • Near the bottom: "This text "
    (one space between “text” and the final quote)

p. 212:

  • At the top of the page: ("Word " + count + ": " + sWord);

p. 222:

  • Near the bottom: ("Word " + count + ": " + sWord);

p. 234:

  • Near the bottom: (""+count)
  • At the bottom: (""+avg)

p. 258:

  • Near the top: "b evaluates to true";
  • The middle of the page: "b evaluates to true";

p. 271:

  • The quotes around each entry in the list in the middle of the page: "a", "an", "and",... (21 entries)
  • Near the bottom: if (s.equals("")) {

p. 276:

  • Common words array, upper middle of the page: "a", "an", "and"

p. 279:

  • 21 code lines: ht.put("a", ""), etc.

p. 285:

  • String of punctuation characters near the top: ".,?!:;\"()$-" (Note the \" sequence inside this string)
  • String of whitespace characters under it: " \t\n\r" (Note the space after the starting quote)

p. 286:

  • Near the top: if (sWord.charAt(j) == '\'') { (single quote, backslash, single quote, single quote)
  • At the bottom; same sequence

p. 288:

  • At the top of the page: char: 'a', '\n', '\377', '\u00A' byte: 'a', '\n', '\377', '\u00A'
  • Middle of the page: i = '\n';
    (single quotes around backslash-n)

p. 289:

  • Bottom of the page: char ch = 'a';

p. 291:

  • Middle of the page: if (sb.charAt(i) == '\n') sb.setCharAt(i, ' ');
    (single quotes around \n, single quotes around a space)
  • Further down: if (sb.charAt(i) == ' ') lastSpace = i;
    (single quotes around a space)
  • Further down, in bold: sb.setCharAt(lastSpace, '\n');
  • Further down, in bold: sb.insert(i++, '\n');

p. 292:

  • Near the bottom:
    if (sb.charAt(i) == '\n') sb.setCharAt(i, ' ');
    if (sb.charAt(i) == ' ') lastSpace = i;
  • At the bottom, in the text: either a space (‘ ‘) or a line break (‘\n‘)

p. 293:

  • At the top: sb.insert(i++, '\n');

p. 330:

  • Step 3:
  • Step 4: same missing quotes
  • Step 6: same missing quotes in btnBlack_ActionPerformed method
  • Same missing quotes in btnWhite_ActionPerformed method

p. 348:

  • Near the bottom:
  • Next code line: "State Machine Demo"
  • Last code line: "State Machine Demo"

p. 482:

  • In step 5, the labels in the property table columns are not lined up properly. The table should read:
Name		Label			Enabled
btnNew      New Game		true
btnPass     __Pass__		false

p. 526:

  • Bold text, lower middle: lblMessage.setText("I must pass.");
  • A few lines down: lblMessage.setText("Moving...");
  • Near the end: lblMessage.setText("Your move.");
  • At the end: lblMessage.setText("You must pass.");

p. 528:

  • Bold text near the top: lblMessage.setText("Your move.");

p. 529:

  • Bold text near the top: "Wait your turn!"
  • Further down: "Move to an empty square!"
    (should be indented, as well)
  • Further down: "You must flip something!"
    (should be indented, as well)

p. 530:

  • Code at the bottom of the page: "Your move."
    "You Won!" "It's a TIE!" (“It’s” needs a single apostrophe as well)

p. 540:

  • Wrapped line should be broken so “Vector” starts under “PieceColor” as on pg 541:
    public void rateMoves(PieceColor...
    Vector moves, ....

p. 549:

  • Near the bottom of the page: //System.out.println("Value="+bestValue);

p. 550

  • Bold text, middle of the page: lblMessage.setText("My move.");
  • A few lines down: lblMessage.setText("I must pass.");
  • Near the end: lblMessage.setText("Your move.");

p. 551:

  • Top of the page: lblMessage.setText("Your move.");

p. 594:

  • Top of the page: startDateLabel.setText("Start Date");
  • The two lines following startDateLabel.setToolTipText( need a single pair of quotes. For legibility, break into two strings on separate lines, joined by "+": "Start date = start-of-day " + "Completion dates = end-of-day." (Space beteen start-of-day and final quote)

p. 615:

  • Badly wrapped line: listeners.elementAt(...) should be indented

p. 619:

  • Code at the top: (! modifiers.equals("Alt"))
    Case statements need single quotes:
	case 'd':
	case 't':
	case 'r':
	case 'n':

p. 622:

  • Upper middle, under case DATECOLUMN: ....return "";
  • Next line: ...return "";

p. 623:

  • Code lines at the bottom:
      putValue(Action.NAME, "Mark Done");
      putValue(Action.SHORT_DESCRIPTION, "Mark a task as done.");

p. 625:

  • Bold code in the middle: b.setText("");

p. 628:

  • Bold code, upper middle: fileNew.setText("New");

p. 629:

  • In Note at the top: getKeyStroke('d'). (single quotes around d)

p. 634:

  • Lower middle: b.setText("");

p. 636:

  • Bold code, lower middle: return new URL("file:" + filePath);

p. 637:

  • Code in the middle of the page:
	new URL("file:" + filePath);

p. 639:

  • Middle: "The current project has changed."
  • Next line: + "Do you want to save your changes?");

p. 649:

  • Near the top: "Scheduler Project";
  • The line below: "Version 1.0";

p. 652:

  • Bottom: setText(""+t.getSpecDur());

p. 653:

  • Near the top: setText(""+t.getSpecDur());

p. 656:

  • Bold code near the top: "The text you entered...characters"));

p. 671:

  • Middle of the page: case "state 1": ...
  • The line below: case "state 2" ...
  • Near the bottom: case s = "foo":

p. 734:

  • Middle: imgPath = "file://" +userDir + fs + fileName;

p. 735:

  • Lower middle: String fs = System.getProperty("file.separator");
  • Line below: String userDir = System.getProperty("user.dir");

p. 737:

  • Near the top: (msgMargin + "Error loading images");

Chapter 11: Getting More Out of JBuilder

Add the following paragraph to page 349:

When you are deploying an applet, you may need to ensure that the deployment wizard picks up Swing “look and feel” classes, JBCL classes, and JGL classes (depending on which classes the applet uses). Otherwise, the applet will work fine in JBuilder but will not work when deployed. Those steps require uncommenting the look and feel rendition-code in the static initializer and making sure not to exclude the JBCL and JGL libaries in the deployment wizard if they are needed. For complete directions, go to: https://we.got.net/~rwilkman/java/jbuilder/index.html and select “Build and Deploy an Applet in JBuilder”. (Thanks to Joseph Walsh for this info.)

Chapter 16: Scheduling a Project

Add the following (step 2.5) to the list under Getting Started on page 565:

Create a new directory, c:\JBuilder2\myprojects\com (assuming that is where JBuilder is installed). Then, using the CD that came with this book, copy the contents of \projects\com to the new directory. This directory contains two Swing “extension: classes for the com.sun.java.swing.tree package, DefaultTreeCellRenderer and DefaultTreeCellEditor. Earlier versions of the Swing libraries do not include these two classes, although later versions should.

Add the following to step three in the list under Getting Started on page 565:

The latest versions of the Swing libaries have migrated to the package /javax/swing. If you download such a version, you will need to modify the Scheduler app so that the import statements in each file have the proper path. (The Swing download includes a utility to make that easier. It keeps in mind the fact that while most Swing packages have migrated to /javax/swing, two of the “look & feel” packages have remained behind in com/sun/java/swing. Those packages are for the Motif look & feel and the Windows look & feel.)

Chapter 18: Looking Forward

Add the following to page 665, under “Database Access”:

To get a CD-based multimedia tutorial on database programming with JBuilder, go to https://www.referentia.com/products/rfj/rfjvol2.htm.

Appendix A: Troubleshooting Tips

Add the following to Program Runtime Errors on page 689:

"Can't run deployed applet"

If the applet runs fine in the development enviroment, but does not run when packaged into a JAR file, you may need to uncomment the code that loads the Swing look & feel classes in the static initializer. If the applet uses classes in the JBCL or JGL libraries, you may also need to make sure that they are not excluded by the deployment wizard. For more information, seehttps://we.got.net/~rwilkman/java/jbuilder/index.html, and select “Build and Deploy an Applet in JBuilder”.

Appendix E: Additional Resources

Add the following to Java Software, Utilities, and APIs on page 744:

Item: Additional Swing-based components
URL: https://www.freeyellow.com/members6/pingsoft/kiwi.html
A library of additional components for the Swing tookit. Freely downloadable. Includes a date chooser component.

Please share!

1 Comment

    Trackbacks & Pingbacks

    1. Publications | Treelight.com June 19, 2017 (7:22 am)

      […] a more powerful and more elegant mechanism for many of the data structures used in the examples. Errata Page for The JBuilder Java Bible Unfortunately, many quotation marks went missing when the book went to […]

    Add your thoughts...

    This site uses Akismet to reduce spam. Learn how your comment data is processed.