Class chap5.ch5_fig18
All Packages Class Hierarchy This Package Previous Next Index
Class chap5.ch5_fig18
java.lang.Object
|
+----java.awt.Component
|
+----java.awt.Container
|
+----java.awt.Panel
|
+----java.applet.Applet
|
+----chap5.ch5_fig18
- public final class ch5_fig18
- extends Applet
- implements Runnable
A class that displays a grid (via FlowLayout) of images
whose URLs are passed in from the HTML page. While the images
are being loaded, we display expanding circles in the spaces
the images would occupy. Example of ImageObserver use.
-
ImageName
-
-
bImageLoadingError
-
-
current
-
-
init()
- Create the image name Vector, then fill it with Image
parameters retrieved from the HTML page.
-
paint(Graphics)
- Paint the applets display space.
-
run()
- The main loop for this thread.
-
start()
- start - Whenever a user visits our page, Applet calls this.
-
stop()
- Stop this thread.
bImageLoadingError
public boolean bImageLoadingError
ImageName
public Vector ImageName
current
public static ch5_fig18 current
start
public void start()
- start - Whenever a user visits our page, Applet calls this. This is
an override of an Applet method. Creates a thread and passes this
AgentLauncher into it. Works because we implement the Runnable method.
- Overrides:
- start in class Applet
stop
public void stop()
- Stop this thread.
- Overrides:
- stop in class Applet
run
public synchronized void run()
- The main loop for this thread. Sleep for 1/3 second, then
repaint all the panels. Only runs for as long as it takes for
the images to load.
init
public void init()
- Create the image name Vector, then fill it with Image
parameters retrieved from the HTML page. Create Panel array.
- Overrides:
- init in class Applet
paint
public void paint(Graphics g)
- Paint the applets display space. Repaints each of the
Panels. Checks whether all the images have been displayed. If
so, it kills the thread that called this by setting myThread to
null. This method will STILL get called by the browser whenever
it needs to repaint this window.
- Overrides:
- paint in class Component
All Packages Class Hierarchy This Package Previous Next Index