Package javax.swing

Examples of javax.swing.Timer$Task


protected Timer timer;

public FocusSetter(JComponent comp) {
    component = comp;
    if (component != null) {
  timer = new Timer(WAIT_MILLISECS, this);
  timer.setRepeats(false);
  timer.start();
    }
}
View Full Code Here


        if ((noTimerOverOMGraphic && getMovementInterest() != null)
                || mouseTimerInterval <= 0) {
            return updateMouseMoved(e);
        } else {
            if (mouseTimer == null) {
                mouseTimer = new Timer(mouseTimerInterval, mouseTimerListener);
                mouseTimer.setRepeats(false);
            }

            mouseTimerListener.setEvent(e);
            mouseTimer.restart();
View Full Code Here

    /**
     * Creates a timer with the current updateInterval and calls setTimer().
     */
    public void createTimer() {
        Timer t = new Timer(updateInterval, null);
        t.setInitialDelay(initialDelay);
        setTimer(t);
    }
View Full Code Here

     * Checks to see if there is a timer, and if the component wants to
     * automatically update the current image. If the timer isn't running, it's
     * started.
     */
    public void handleUpdate() {
        Timer timer = getTimer();

        if (timer != null && (isAutoUpdate() || !timer.isRunning())) {
            timer.restart();
        }
        // Else do nothing, the timer is running and will pick up the
        // changes.
    }
View Full Code Here

                }
                timerButton = new JCheckBox(bTitle, getTimer().isRunning());
                timerButton.addActionListener(new ActionListener() {
                    public void actionPerformed(ActionEvent ae) {
                        JCheckBox check = (JCheckBox) ae.getSource();
                        Timer t = getTimer();
                        if (t != null) {
                            if (check.isSelected()) {
                                t.restart();
                            } else {
                                t.stop();
                            }
                        }
                    }
                });
                timerButton.setToolTipText("<HTML><BODY>Reload the map data from the original source at specified intervals.</BODY></HTML>");
View Full Code Here

    /**
     * Creates a timer with the current updateInterval and calls
     * setTimer().
     */
    public void createTimer() {
        Timer t = new Timer(updateInterval, new ActionListener() {
            public void actionPerformed(ActionEvent ae) {
                timerPing();
            }
        });

        t.setInitialDelay(0);
        setTimer(t);
    }
View Full Code Here

    /**
     * Creates a timer with the current updateInterval and calls
     * setTimer().
     */
    public void createTimer() {
        Timer t = new Timer(updateInterval, this);
        t.setInitialDelay(0);
        setTimer(t);
    }
View Full Code Here

        updateInterval = PropUtils.intFromProperties(properties, prefix
                + UpdateIntervalProperty, updateInterval);

        if (updateInterval > 0) {
            timer = new Timer(updateInterval, this);
        }

        termFade = PropUtils.floatFromProperties(properties, prefix
                + TermFadeProperty, termFade);
View Full Code Here

    } catch (UnsupportedOperation e) {
      e.printStackTrace();
    }
   
    // Calls ourselves each half of a second
    timer = new Timer(500, this);
  }
View Full Code Here

     *                 Periood in milliseconds that base timer should fire.
     */
    public SourcedTimer(TimeSource src, int granularity) {
  source = src;
  event = new SourcedTimerEvent(this, 0);
  baseTimer = new Timer(granularity, this);
  baseTimer.setInitialDelay(0);
    }
View Full Code Here

TOP

Related Classes of javax.swing.Timer$Task

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.