Class chap4.ch4_fig11
All Packages Class Hierarchy This Package Previous Next Index
Class chap4.ch4_fig11
java.lang.Object
|
+----java.awt.Component
|
+----java.awt.Container
|
+----java.awt.Panel
|
+----java.applet.Applet
|
+----chap4.ch4_fig11
- public class ch4_fig11
- extends Applet
- implements Runnable
An applet that finds the other applets that exist within
this AppletContext, fights with them to write a string to the
browser status line, and writes a string directly into the
other applet windows. Modified to stop and 'disappear' from
the screen if the user clicks on the applet.
-
init()
- Initialize the applet.
-
mouseDown(Event, int, int)
- If the user clicks on the applet, stop it.
-
paint(Graphics)
- Paint our window.
-
run()
- The main loop for the main thread.
-
start()
- Start the main thread for this game.
-
stop()
- Stop this thread.
start
public void start()
- Start the main thread for this game.
- Overrides:
- start in class Applet
stop
public void stop()
- Stop this thread.
- Overrides:
- stop in class Applet
run
public void run()
- The main loop for the main thread.
paint
public void paint(Graphics g)
- Paint our window. Display a string in this window for
each applet we find, then display a string in each of the other
applets windows.
- Overrides:
- paint in class Component
mouseDown
public boolean mouseDown(Event e,
int x,
int y)
- If the user clicks on the applet, stop it.
- Returns:
- false
- Overrides:
- mouseDown in class Component
init
public void init()
- Initialize the applet. Resize it and give it a name. Make
sure that the applet is 'named' via the applet tag.
- Overrides:
- init in class Applet
All Packages Class Hierarchy This Package Previous Next Index