Whole document tree
javax.swing
|
Field Summary | |
protected EventListenerList |
listenerList
|
Constructor Summary | |
Timer(int delay,
ActionListener listener)
Creates a Timer that will notify its listeners every delay milliseconds. |
Method Summary | |
void |
addActionListener(ActionListener listener)
Adds an actionListener to the Timer |
protected void |
fireActionPerformed(ActionEvent e)
Notify all listeners that have registered interest for notification on this event type. |
int |
getDelay()
Returns the Timer's delay. |
int |
getInitialDelay()
Returns the Timer's initial delay. |
EventListener[] |
getListeners(Class listenerType)
Return an array of all the listeners of the given type that were added to this timer. |
static boolean |
getLogTimers()
Returns true if logging is enabled. |
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(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)
Enables or disables the timer log. |
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, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected EventListenerList listenerList
Constructor Detail |
public Timer(int delay, ActionListener listener)
delay
- The number of milliseconds between listener notificationlistener
- An initial listenersetInitialDelay(int)
,
setRepeats(boolean)
Method Detail |
public void addActionListener(ActionListener listener)
public void removeActionListener(ActionListener listener)
protected void fireActionPerformed(ActionEvent e)
EventListenerList
public EventListener[] getListeners(Class listenerType)
public static void setLogTimers(boolean flag)
flag
- true to enable logginggetLogTimers()
public static boolean getLogTimers()
setLogTimers(boolean)
public void setDelay(int delay)
setInitialDelay(int)
public int getDelay()
setDelay(int)
public void setInitialDelay(int initialDelay)
setDelay(int)
public int getInitialDelay()
setDelay(int)
public void setRepeats(boolean flag)
public boolean isRepeats()
setRepeats(boolean)
public void setCoalesce(boolean flag)
public boolean isCoalesce()
setCoalesce(boolean)
public void start()
stop()
public boolean isRunning()
start()
public void stop()
start()
public void restart()
|
JavaTM 2 Platform Std. Ed. v1.3.1 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Java, Java 2D, and JDBC are trademarks or registered trademarks of Sun Microsystems, Inc. in the US and other countries.
Copyright 1993-2001 Sun Microsystems, Inc. 901 San Antonio Road
Palo Alto, California, 94303, U.S.A. All Rights Reserved.