Corrections to Chapter 6 of Java Network Programming, The Network Methods of java.applet.Applet

p. 113: There are some extra closing parentheses at the ends of the last three code fragments. They should be:
Image myImage = getImage(getCodeBase(), "logo.gif");
Image myImage = getImage( getDocumentBase(), "logo.gif");
Image myImage = getImage( getDocumentBase(), "images/logo.gif");
p. 114: The last code fragment at the bottom of the page has an extra closing parenthesis at the end. It should be

play(getCodeBase(), "gong.au");
p. 115: The first two code fragments at the top of the page have extra closing parentheses. They should be:

play(getDocumentBase(), getParameter("soundfile"));
play (getDocumentBase(), "sounds/gong.au");
p. 116: The first and third code fragments on the page have extra pparentheses. They should be:

getAudioClip(getCodeBase(), "gong.au");
getAudioClip (getDocumentBase(), "sounds/gong.au");
p. 130-131: The two code fragments in the statusID() section incorrectly use statusAll() instead of statusID(). The first should be:

if ((m.statusID(2, false) & ImageObserver.COMPLETED) == ImageObserver.COMPLETED) {

The second at the top of p. 131 should be:

(m.statusID(2, false) & ImageObserver.ABORTED) == ImageObserver.ABORTED)

p. 148: The second to last paragraph should read:

The Multihome applet redirects requests for http://www.siteA.com/somedirectory/somefile.html to requests for http://www.siteA.com/www.siteA.com/somedirectory/somefile.html, requests for http://www.siteB.com/somedirectory/somefile.html to requests for http://www.siteB.com/www.siteB.com/somedirectory/somefile.html, and so on.

[ Java Network Programming Corrections | Java Network Programming Home Page | Table of Contents | Examples | Order from Amazon ] ]

Copyright 1998, 1999 Elliotte Rusty Harold
elharo@metalab.unc.edu
Last Modified February 14, 2000