Main Applet Methods
Although an applet can have many methods, here are five main methods that you need to be aware of:
init()
start()
paint()
stop()
destroy()
The init() method is the place to put code that sets up the applet screen, such as adding Buttons or text fields or creating Image objects within limits. It is also the place to start the downloading of images through a separate thread using the MediaTracker class discussed later. Think of init() as analogous to a constructor. Applets do not have explicit constructors.
The start() method is where you initiate what must happen when a user goes to your applet's Web page. Here is a sample scenario. Five Web pages are up, one of which has your applet on it. At first, the user ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access