Java javax.swing Timer fields, constructors, methods, implement or subclass

Example usage for Java javax.swing Timer fields, constructors, methods, implement or subclass

Introduction

In this page you can find the methods, fields and constructors for javax.swing Timer.

The text is from its open source code.

Subclass

javax.swing.Timer has subclasses.
Click this link to see all its subclasses.

Constructor

Timer(int delay, ActionListener listener)
Creates a Timer and initializes both the initial delay and between-event delay to delay milliseconds.

Method

voidaddActionListener(ActionListener listener)
Adds an action listener to the Timer.
ClassgetClass()
Returns the runtime class of this Object .
intgetDelay()
Returns the delay, in milliseconds, between firings of action events.
booleanisRepeats()
Returns true (the default) if the Timer will send an action event to its listeners multiple times.
booleanisRunning()
Returns true if the Timer is running.
voidrestart()
Restarts the Timer, canceling any pending firings and causing it to fire with its initial delay.
voidsetCoalesce(boolean flag)
Sets whether the Timer coalesces multiple pending ActionEvent firings.
voidsetDelay(int delay)
Sets the Timer's between-event delay, the number of milliseconds between successive action events.
voidsetInitialDelay(int initialDelay)
Sets the Timer's initial delay, the time in milliseconds to wait after the timer is started before firing the first event.
voidsetLogTimers(boolean flag)
Enables or disables the timer log.
voidsetRepeats(boolean flag)
If flag is false, instructs the Timer to send only one action event to its listeners.
voidstart()
Starts the Timer, causing it to start sending action events to its listeners.
voidstop()
Stops the Timer, causing it to stop sending action events to its listeners.