Class chap5.ch5_fig13
All Packages Class Hierarchy This Package Previous Next Index
Class chap5.ch5_fig13
java.lang.Object
|
+----java.awt.Component
|
+----java.awt.Container
|
+----java.awt.Panel
|
+----java.applet.Applet
|
+----chap5.ch5_fig13
- public class ch5_fig13
- extends Applet
- implements Runnable
A stock-style ticker that runs a one-line string through a
horizontal box. Allows picking the foreground and background
color, the font and size of the string, and sizes the box
appropriately to the chosen font/size.
-
currentBkClridx
-
-
currentFontChoice
-
-
currentFontIndex
-
-
currentFrClrIdx
-
-
changeFontOrColor()
- Called when either the font or color has been changed via
the font/color controls.
-
init()
- Initialize the applet.
-
run()
- The run loop.
-
start()
- Applet.start override.
-
stop()
- If the ticker is running, make it stop, and set the applet
thread to null so that the applet run loop exits.
currentFontChoice
public String currentFontChoice
currentBkClridx
public int currentBkClridx
currentFrClrIdx
public int currentFrClrIdx
currentFontIndex
public int currentFontIndex
start
public void start()
- Applet.start override. Starts a new thread for the applet
to run in if one doesn't exist, else does nothing.
- Overrides:
- start in class Applet
changeFontOrColor
public void changeFontOrColor()
- Called when either the font or color has been changed via
the font/color controls. Gets current settings from font/color
controls and sets the font within the ticker Component such
that the next time the string gets painted, it will use the new
font.
stop
public void stop()
- If the ticker is running, make it stop, and set the applet
thread to null so that the applet run loop exits.
- Overrides:
- stop in class Applet
run
public void run()
- The run loop. Does nothing except sit sleeping for 1
second at a time.
init
public void init()
- Initialize the applet. Create and initialize the font/color
choice controls and set the default values for each.
- Overrides:
- init in class Applet
All Packages Class Hierarchy This Package Previous Next Index