|
acm.util
Class SwingTimer
java.lang.Object
|
+--javax.swing.Timer
|
+--acm.util.SwingTimer
public class SwingTimer extends Timer
This class is equivalent to javax.swing.Timer and
exists only to avoid the ambiguity that arises because there is
also a Timer class in java.util.
public SwingTimer(int rate,
ActionListener listener)
- Creates a new timer that ticks at the specified rate. On each tick,
the timer sends an ActionEvent to the listener.
-
Usage: | SwingTimer timer = new SwingTimer(rate, listener); |
Parameters: |
rate | The number of milliseconds between ticks
|
listener | The ActionListener receiving the events
|
|
|