Errata

Java AWT Reference

Errata for Java AWT Reference

Submit your own errata for this product.

The errata list is a list of errors and their corrections that were found after the product was released. If the error was corrected in a later version or reprint the date of the correction will be displayed in the column titled "Date Corrected".

The following errata were submitted by our customers and approved as valid errors by the author or editor.

Color key: Serious technical mistake Minor technical mistake Language or formatting error Typo Question Note Update

Version Location Description Submitted By Date submitted Date corrected
Printed
Page 31
line -1: changed "clockwise" to "counter-clockwise"

Anonymous    Aug 01, 1997
Printed
Page 32
line 1: changed "clockwise" to "counter-clockwise"

and line

Anonymous    Aug 01, 1997
Printed
Page 37
The first line of text has only one word; the rest of the

paragraph should be brought up.

Anonymous   
Printed
Page 77, 668
FontMetrics::getWidths() returns an array of 256 ints, not

255 (0 to 255)

Anonymous   
Printed
Page 84
under heading public static Color getColor(String name, Color

defaultColor), second paragraph there is a big hole in the second
line.

Anonymous   
Printed
Page 97
There needs to be a footnote after the clause "Using the screen

in Figure 4-1 as the basis," in section 4.1.3:

The call path shown is generated by following the methods called from
the Java source code (.java files). It is possible that a platform
reduces the overhead by performing some operations in the Java peers.

Anonymous   
Printed
Page 180
In the Keyboard section, the method signatures

public boolean keyDown(Event e, int key)
public boolean keyUp(Event e, int key)

should both have a hollow star (Java 1.0 depricated method) next
to them. keyDown currently has a solid star and keyUp does not
have either.

Anonymous   
Printed
Page 207
Container::component add(Component, int) end of 1st paragraph

if you try to add _component_ to to a container that already contains
it, the COMPONENT is removed and re-added, probably at a different
position.

Anonymous   
Printed
Page 212
In discussion of the invalidate() method: "recursively

invalidates the children" should be "recursively invalidates the
parent containers"

Anonymous   
Printed
Page 212
line -2: added "synchronized" before "void"

Anonymous    Aug 01, 1997
Printed
Page 229
Change text of section titled: Listeners and 1.1 event handling

[This includes top of the next page]

With the 1.1 event model, you register listeners for different event
types; the listeners are told when the event happens. The Frame class
inherits all its listener handling from Window.

With Java 1.1, it isn't necessary to subclass Frame to handle the
WINDOW_CLOSING events. The equivalent Java 1.1 code to handle the event
follows:

Frame f = new Frame();
f.addWindowListener (new WindowAdapter() {
public void windowClosing (WindowEvent e) {
setVisible(false);
dispose();
System.exit(0);
}
});

This adds an anonymous inner class of type WindowAdapter as the
WindowListener. When the window closing event happens, it causes the
program to exit. Every Frame created should include code like this to
make sure they terminate gracefully.

Anonymous   
Printed
Page 274
in the description of "public int[][] getLayoutDimenstions ()",

sentence 2: "Index 0 is an array of widths" should be "Index 0 is a
copy of an array of widths" and "index 1 is an array of heights"
should be "index 1 is a copy of an array of heights"

Anonymous   
Printed
Page 307
added "synchronized" to line after 1st header

Anonymous    Aug 01, 1997
Printed
Page 353
"public int getSelectedCheckbox()" should be "public

Checkbox getSelectedCheckbox()".

Anonymous   
Printed
Page 358
under "events": added white star after "public boolean postEvent

(Event e)"

Anonymous    Aug 01, 1997
Printed
Page 360
10.2.1: added a white star to middle item

Anonymous    Aug 01, 1997
Printed
Page 364
the list item

public void addActionListener(ItemListener listener)
should be
public synchronized void addActionListener(ActionListener listener)

and the list item:

public void removeActionListener(ItemListener listener)
should be
public synchronized void removeActionListener(ActionListener listener)

Anonymous   
Printed
Page 370
OK, here's the background. Solaris machine running Java 1.1,

but using 1.0 event model. CheckboxMenuItem is supposed to return an
arg, which is the string of the label of the CheckboxMenuItem.
Instead, the arg of action() produces a boolean, which is the state of
the CheckboxMenuItem.

from the author: The behavior that you noticed seems to be a
compatibility difference that Sun doesn't document and I missed too.
Under 1.0, the CheckboxMenuItem action has the label as its argument.
While running a 1.0 event model program under 1.1, this is the state.

Anonymous   
Printed
Page 620
line 12 of "Class Definition": added "synchronized" before "void"

Anonymous    Aug 01, 1997
Printed
Page 622
under "addContainerListender": added "synchronized" before "void"

Anonymous    Aug 01, 1997
Printed
Page 625
Container.invalidate(): method is missing filled star, and

description should be changed to:

Notifies container's layout manager of invalid state and invalidates
parent containers.

Anonymous   
Printed
Page 653
The description for postEvent is missing.

Anonymous   
Printed
Page 741
line -3: added a white star

Anonymous    Aug 01, 1997
Printed
Page 742
last item: added a white star

Anonymous    Aug 01, 1997
Printed
Page 744
line 5 of "Class Definition:" added a white star

Anonymous    Aug 01, 1997
Printed
Page 796
19.58, Class Definition, line 4: added "synchronized" before "void"

Anonymous    Aug 01, 1997
Printed
Page 797
Instance Methods: added "synchronized" before "void"

Anonymous    Aug 01, 1997
Printed
Page 959
The handleEvent method should have a parameter of type

"AWTEvent", not "Event". This should also be corrected in the
parameter description where "Event" appears in Courier. There needs to
be a star or a footnote for this change. In Java 1.0, the parameter
is of type Event. However, in 1.1, the parameter is of type AWTEvent.

Anonymous   
Printed
Page 999-1002
There are several references to an "ARCHIVES=" parameter to

the <APPLET> tag in HTML. According to Sun's documentation, and
confirmed by my own testing, the correct name of this parameter is
"ARCHIVE" (no plural).

Anonymous   
Printed
Page 999
code line 6: changed "ARCHIVES" to "ARCHIVE"

Anonymous    Aug 01, 1997
Printed
Page 1000
changed para. 6: changed "ARCHIVES" to "ARCHIVE" and added new

first sentence:

"filename.zip/filename/jar, optional. Points to a comma-separated list of
uncompressed ZIP or JAR files that contain one or more Java classes. Each
file is downloaded once to the user's disk and serched for the class named
in the CODE parameter, and any helper classes required to execute that
class. . . ."

Anonymous    Aug 01, 1997