Class Ticker.Ticker
All Packages Class Hierarchy This Package Previous Next Index
Class Ticker.Ticker
java.lang.Object
|
+----java.lang.Thread
|
+----Ticker.Ticker
- public class Ticker
- extends Thread
A class that runs a string through a window from left to right as if
it were a stock ticker.
-
Ticker(Applet, Vector, int, int, int, int)
- Constructor.
-
Ticker(Applet, String, int, int, int, int)
- Constructor.
-
paint1(Graphics, int)
- Paint an updated version of the ticker, moving the displayed string
1 pixel to the left.
-
paintFirst(Graphics)
- Setup the ticker display initial state by painting the string across
the window, truncated to whatever width the ticker allows.
-
repaint(Graphics)
- A version of paintFirst.
-
run()
- Call paintFirst to setup the ticker window, then sit in a loop,
conditioned on bTrue, calling paint1 to move the
ticker relentlessly to the left.
-
stopIt()
- Stop the ticker thread by setting bRun to false.
Ticker
public Ticker(Applet a,
Vector v,
int x,
int y,
int w,
int waittime)
- Constructor.
- Parameters:
- a - The Applet that created this ticker.
- v - A Vector of Strings that will be used as the ticker
items, each item separated by a space.
- x - The x location of the ticker within the applet.
- y - The y location of the ticker within the applet.
- w - The width of the ticker.
Ticker
public Ticker(Applet a,
String inputString,
int x,
int y,
int w,
int waittime)
- Constructor.
- Parameters:
- a - The Applet that created this ticker.
- inputString - A Strings that will be used as the ticker item.
- x - The x location of the ticker within the applet.
- y - The y location of the ticker within the applet.
- w - The width of the ticker.
run
public void run()
- Call paintFirst to setup the ticker window, then sit in a loop,
conditioned on bTrue, calling paint1 to move the
ticker relentlessly to the left. Delay before each paint1 call for
Delay milliseconds.
- Overrides:
- run in class Thread
stopIt
public void stopIt()
- Stop the ticker thread by setting bRun to false.
paintFirst
public void paintFirst(Graphics g)
- Setup the ticker display initial state by painting the string across
the window, truncated to whatever width the ticker allows. Called once.
repaint
public void repaint(Graphics g)
- A version of paintFirst. Not used.
paint1
public void paint1(Graphics g,
int inc)
- Paint an updated version of the ticker, moving the displayed string
1 pixel to the left.
All Packages Class Hierarchy This Package Previous Next Index