Starting with init()

The init() method of an applet automatically is handled once when the applet first starts to run. This method is used to assign values to the arrays pageTitle and pageLink. It also is used to create a clickable button that appears on the applet. The method consists of the following statements:

public void init() {    pageTitle = new String[] {        "Sun's Java site",        "Cafe au Lait",        "JavaWorld",        "Java in 24 Hours",        "Sams Publishing",        "Workbench"        };    pageLink[0] = getURL("http://java.sun.com");    pageLink[1] = getURL("http://www.ibiblio.org/javafaq");    pageLink[2] = getURL("http://www.javaworld.com");    pageLink[3] = getURL("http://www.java24hours.com");    pageLink[4] = getURL( ...

Get Sams Teach Yourself Java™ in 24 Hours, Sixth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.