Package javax.swing

Examples of javax.swing.Timer.addActionListener()


          return;
        }

        final Timer timer = new Timer(100, null);
        final Mote mote = (Mote) obj;
        timer.addActionListener(new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            /* Count down */
            if (timer.getDelay() < 90) {
              timer.stop();
              highlightedMotes.remove(mote);
View Full Code Here


    if (!REPLAY_TEMP_DATA) {
      connectToCOMPort();
    }
    Timer updateTimer = new Timer(500, null);
    updateTimer.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
//     parseIncomingLine(TEMP_NODE_DATA[TEMP_COUNTER]);
//     TEMP_COUNTER = (TEMP_COUNTER + 1) % TEMP_NODE_DATA.length;
    try {
        updateCharts();
View Full Code Here

  });
    updateTimer.start();

    if (REPLAY_TEMP_DATA) {
  //      Timer updateTimer = new Timer(1000, null);
      updateTimer.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
          parseIncomingLine(TEMP_NODE_DATA[TEMP_COUNTER]);
          TEMP_COUNTER = (TEMP_COUNTER + 1) % TEMP_NODE_DATA.length;
          updateCharts();
        }
View Full Code Here

             * afterwards. The code with the ReleasedAction handles if the Timer thread actually fires the action due to
             * lags, by cancelling the action itself upon the PRESSED.
             */
            final Timer timer = new Timer(2, null);
            ReleasedAction action = new ReleasedAction(keyEvent, timer);
            timer.addActionListener(action);
            timer.start();

            _map.put(Integer.valueOf(keyEvent.getKeyCode()), action);

            // Consume the original
View Full Code Here

          return;
        }

        final Timer timer = new Timer(100, null);
        final Mote mote = (Mote) obj;
        timer.addActionListener(new ActionListener() {
          @Override
          public void actionPerformed(ActionEvent e) {
            /* Count down */
            if (timer.getDelay() < 90) {
              timer.stop();
View Full Code Here

        }

        // Periodically ask the MailBug thread to see if there is a newer version or not
        final long now = System.currentTimeMillis();
        final Timer t = new Timer(800, null);
        t.addActionListener(new ActionListener() {
           public void actionPerformed(ActionEvent e) {
              int n = MailBug.latestBuildNumber();
              // If beyond 3 seconds, then we should stop because the log message may run into other user messages
              if (System.currentTimeMillis() - now >= 3000 || n <= Version.buildNumber()) { t.stop(); return; }
              latestAlloyVersion = n;
View Full Code Here

          return;
        }

        final Timer timer = new Timer(100, null);
        final Mote mote = (Mote) obj;
        timer.addActionListener(new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            /* Count down */
            if (timer.getDelay() < 90) {
              timer.stop();
              highlightedMotes.remove(mote);
View Full Code Here

          return;
        }

        final Timer timer = new Timer(100, null);
        final Mote mote = (Mote) obj;
        timer.addActionListener(new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            /* Count down */
            if (timer.getDelay() < 90) {
              timer.stop();
              highlightedMotes.remove(mote);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.