Previous | Next | Trail Map | Writing Applets | Overview of Applets


Threads in Applets: Examples

This page points to two pages with thread-using applets. One applet (Good) performs computation-intensive initialization in a separate thread. The other (Bad) performs the same initialization directly in its init() method.

The exact results of these applets' execution depend on the browser that contains the applets. However, these applets are likely to demonstrate clearly the following rule: Whenever an applet performs a lengthy operation, it should use a separate thread (which it creates) to perform the operation.

To compare these applets' execution, follow these steps:

  1. Bring up a new browser window (such as by cloning this page or starting up another browser process).
  2. From one browser window, view the page that has the Good applet.
  3. From the other browser window, view the page that has the Bad applet.


Previous | Next | Trail Map | Writing Applets | Overview of Applets