public class Timer
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private int |
delay |
private TimerListener |
myListener |
private java.lang.Thread |
myThread |
private boolean |
running |
Constructor and Description |
---|
Timer(int theDelay,
TimerListener el)
Create a Timer object.
|
Modifier and Type | Method and Description |
---|---|
int |
getDelay()
access how man milliseconds between timedOut() messages.
|
void |
setDelay(int newDelay)
Change the delay between timedOut messages.
|
void |
start()
Starts the timer, telling it to send timeOut() methods
to the TimerListener.
|
void |
stop()
Stops the timer.
|
private TimerListener myListener
private java.lang.Thread myThread
private int delay
private boolean running
public Timer(int theDelay, TimerListener el)
public int getDelay()
public void setDelay(int newDelay)
public void stop()
public void start()