List of usage examples for javax.swing Timer isRepeats
public boolean isRepeats()
true
(the default) if the Timer
will send an action event to its listeners multiple times. From source file:com.haulmont.cuba.desktop.gui.components.DesktopTimer.java
@Override public void start() { if (!started) { timer = new Timer(delay, e -> { Timer timerBefore = timer; onTimerAction();//from ww w . j a va2s. c om // if user didn't stop or restart timer if (timerBefore == timer && !timerBefore.isRepeats()) { stop(); } }); timer.setRepeats(repeating); timer.start(); this.started = true; } }