Thank you for visiting Blazing Games

Important applet methods

For controlling an applet, there are 4 methods that your web browser uses to communicate with the applet. While you do not need to override any of these methods, it is a good idea to be aware of them.

The init method is called the first time your applet is about to be ran. This is where you should place your applet initialization code. This is also a good place to analyze the applet parameters.

Whenever your applet is started, the start method is called. One thing that should be noted is that when you go to a different page and then return to a page, the applet is not started over. Instead, the start method is called. If you are going to be doing threading (explained in a future chapter), this is a good place to prepare the threading, with stop used to stop the threading. I should also point out that in future versions of windows, the thread start and stop methods have been depreciated.

When a browser goes to a different page, the applet is not destroyed. Instead, the stop method is called. If you are doing any type of threading activity, here is a good place to stop the threads.

Applets are removed from memory when a browser is closed, though going through a bunch of pages may also cause an applet to be removed from memory, depending on the browser you are using. Before an applet is removed from memory the destroy method is called. This is where any special shutdown tasks can be performed.

Previous Chapter 4 Contents Page 5 of 10 Book Contents Next

About - Privacy Policy - Contact - Links - FAQ
Copyright © 2003-2006 Blazing Games Inc. All Rights Reserved