September 2005
Beginner
576 pages
13h 6m
English
The last thing to take care of in the Revolve applet is event-handling: Whenever a user clicks the Go button, the web browser should open the website that is listed. This is done with a method called actionPerformed(). The actionPerformed() method is called whenever the button is clicked.
The following is the actionPerformed() method of the Revolve applet:
public void actionPerformed(ActionEvent evt) {
if (runner != null) {
runner = null;
}
AppletContext browser = getAppletContext();
if (pageLink[current] != null) {
browser.showDocument(pageLink[current]);
}
The first thing that happens in this method is that the runner thread is stopped in the same way it was stopped in the applet's stop() method. The next statement creates ...
Read now
Unlock full access