Overview | Package | Class | Tree | Deprecated | Index | Help |
Java Platform 1.1.7 |
||
PREV CLASS | NEXT CLASS | FRAMES | NO FRAMES | ||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.sun.java.swing.Timer
Using a Timer involves first creating it, then starting it using the start() method.
Warning: serialized objects of this class will not be compatible with future swing releases. The current serialization support is appropriate for short term storage or RMI between Swing1.0 applications. It will not be possible to load serialized Swing1.0 objects with future releases of Swing. The JDK1.2 release of Swing will be the compatibility baseline for the serialized form of Swing objects.
Field Summary | |
EventListenerList | listenerList
|
Constructor Summary | |
Timer(int delay,
java.awt.event.ActionListener listener)
Creates a Timer that will notify its listeners every delay milliseconds. |
Method Summary | |
void | addActionListener(java.awt.event.ActionListener listener)
Adds an actionListener to the Timer |
void | fireActionPerformed(java.awt.event.ActionEvent e)
|
int | getDelay()
Returns the Timer's delay. |
int | getInitialDelay()
Returns the Timer's initial delay. |
static boolean | getLogTimers()
|
boolean | isCoalesce()
Returns true if the Timer coalesces multiple pending performCommand() messages. |
boolean | isRepeats()
Returns true if the Timer will send a actionPerformed() message to its listeners multiple times. |
boolean | isRunning()
Returns true if the Timer is running. |
void | removeActionListener(java.awt.event.ActionListener listener)
Removes an ActionListener from the Timer. |
void | restart()
Restarts a Timer, canceling any pending firings, and causing it to fire with its initial dely. |
void | setCoalesce(boolean flag)
Sets whether the Timer coalesces multiple pending ActionEvent firings. |
void | setDelay(int delay)
Sets the Timer's delay, the number of milliseconds between successive actionPerfomed() messages to its listeners |
void | setInitialDelay(int initialDelay)
Sets the Timer's initial delay. |
static void | setLogTimers(boolean flag)
|
void | setRepeats(boolean flag)
If flag is false, instructs the Timer to send actionPerformed() to its listeners only once, and then stop. |
void | start()
Starts the Timer, causing it to send actionPerformed() messages to its listeners. |
void | stop()
Stops a Timer, causing it to stop sending actionPerformed() messages to its Target. |
Methods inherited from class java.lang.Object | |
clone, equals, finalize, getClass, hashCode, notifyAll, notify, toString, wait, wait, wait |
Field Detail |
protected EventListenerList listenerList
Constructor Detail |
public Timer(int delay, java.awt.event.ActionListener listener)
delay
- The number of milliseconds between listener notification
listener
- An initial listenerMethod Detail |
public void addActionListener(java.awt.event.ActionListener listener)
public void removeActionListener(java.awt.event.ActionListener listener)
protected void fireActionPerformed(java.awt.event.ActionEvent e)
public static void setLogTimers(boolean flag)
public static boolean getLogTimers()
public void setDelay(int delay)
public int getDelay()
public void setInitialDelay(int initialDelay)
public int getInitialDelay()
public void setRepeats(boolean flag)
public boolean isRepeats()
public void setCoalesce(boolean flag)
public boolean isCoalesce()
public void start()
public boolean isRunning()
public void stop()
public void restart()
Overview | Package | Class | Tree | Deprecated | Index | Help |
Java Platform 1.1.7 |
||
PREV CLASS | NEXT CLASS | FRAMES | NO FRAMES | ||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |