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.

Variable Index

 o currentBkClridx
 o currentFontChoice
 o currentFontIndex
 o currentFrClrIdx

Method Index

 o changeFontOrColor()
Called when either the font or color has been changed via the font/color controls.
 o init()
Initialize the applet.
 o run()
The run loop.
 o start()
Applet.start override.
 o stop()
If the ticker is running, make it stop, and set the applet thread to null so that the applet run loop exits.

Variables

 o currentFontChoice
  public String currentFontChoice
 o currentBkClridx
  public int currentBkClridx
 o currentFrClrIdx
  public int currentFrClrIdx
 o currentFontIndex
  public int currentFontIndex

Methods

 o 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
 o 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.
 o 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
 o run
  public void run()
The run loop. Does nothing except sit sleeping for 1 second at a time.
 o 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