p. 349: If the target is the load button, then the
readPage()
method should be called,
not the loadApplet()
method.
That is, the action()
method should read:
public boolean action(Event e, Object what) {
if (e.target == restartButton) {
restart();
return true;
}
else if (e.target == reloadButton) {
reload();
return true;
}
else if (e.target == loadButton) {
readPage(thePage.getText());
return true;
}
else if (e.target == removeButton) {
removeApplet();
return true;
}
else if (e.target == thePage) {
loadApplet();
return true;
}
return false;
}