An Example
Home ] Up ] The Default Thread Group ] Creating a Thread Group ] Thread Group Methods ] Thread Group Tree Navigation ] [ An Example ]

 

 

Here's an example of the use of ThreadGroups.

This page contains two Java applets:

  1. An applet that shows the JDK version your browser is running:

    Here's the source for this applet.

  2. An applet that uses the above TestThreadGroup class to list all the ThreadGroups and their Threads, and then, for good measure, lists all the applets that are running.

    Here's the source for this applet

    Note that, because of how the browser implements its security manager, this applet may be unsuccessful, or only partially successful. 

    When run in an appletviewer, it outputs something like:

 
The page was last updated February 19, 2008