Package javax.swing

Examples of javax.swing.Timer$Task


  @Test
  public void testUpdate() throws Exception {
    XmlObject xmlObject = XmlObject.Factory.parse(this.getClass().getResource("/update.xml"));
    Assert.assertNotNull(xmlObject);
        System.out.println(xmlObject.toString());
        Task taskElement = Task.Factory.newInstance();
        TaskMetadata metadata = taskElement.addNewMetadata();
       
        metadata.set(new TaskUnmarshaller().expectElement(xmlObject, "taskMetadata"));
        System.out.println(taskElement.getMetadata().getTaskId());
  }
View Full Code Here


      }
    });

    if (mRemainingSecs > 0) {
      updateCloseBtText();
      mAutoCloseTimer = new Timer(1000, new ActionListener() {
        public void actionPerformed(final ActionEvent evt) {
          handleTimerEvent();
        }
      });
      mAutoCloseTimer.start();
View Full Code Here

      }
  }

  public void connect(MBeanServerConnection mbsc) throws Exception {
    super.connect(mbsc);
    timer = new Timer(1000, new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        action();
      }
    });
    timer.start();
View Full Code Here

      }
    }

    addKeyboardAction();

    mTimer = new Timer(10000, new ActionListener() {
      public void actionPerformed(ActionEvent evt) {
        handleTimerEvent();
      }
    });
    mTimer.start();
View Full Code Here

    });
     
    mInsets = getMargin();
    setUI(new ProgramMenuItemUI(p, mChannelName,mIcon,mShowStartTime,mShowDate,showIcon,mShowName,time));
   
    mTimer = new Timer(10000, new ActionListener() {

      public void actionPerformed(ActionEvent e) {
        repaint();
      }
View Full Code Here

    }
  }
 
  private void installTimer(final String stepHash) {
    final long startTime = System.currentTimeMillis();
    Timer newTimer = new Timer(1000, new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        synchronized(LogPanel.this) {
          if (m_tableIndexes.containsKey(stepHash)) {
            final Integer rn = m_tableIndexes.get(stepHash);
            long elapsed = System.currentTimeMillis() - startTime;
            long seconds = elapsed / 1000;
            long minutes = seconds / 60;
            final long hours = minutes / 60;
            seconds = seconds - (minutes * 60);
            minutes = minutes - (hours * 60);
            final long seconds2 = seconds;
            final long minutes2 = minutes;
            if (!SwingUtilities.isEventDispatchThread()) {
              try {
              SwingUtilities.invokeLater(new Runnable() {
                public void run() {
                  m_tableModel.
                    setValueAt("" + hours + ":" + minutes2 + ":" + seconds2, rn.intValue(), 2);
                }
              });
              } catch (Exception ex) {
                ex.printStackTrace();
              }
            } else {
              m_tableModel.
                setValueAt("" + hours + ":" + minutes2 + ":" + seconds2, rn.intValue(), 2);
            }
          }
        }
      }
    });
    m_timers.put(stepHash, newTimer);
    newTimer.start();
  }
View Full Code Here

    mMainDay = new Date();

    setChannels(channelArr);


    mTimer = new Timer(10000, new ActionListener() {
      public void actionPerformed(ActionEvent evt) {
        handleTimerEvent();
      }
    });
    mTimer.start();
View Full Code Here

            htmlPane = new HtmlPane();
            htmlPane.setAntiAlias(antiAlias);
            htmlPane.addHyperlinkListener(this);
            setView(htmlPane);
            timer = new Timer(1000 / fps, new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    int maxY = htmlPane.getHeight() - getHeight();
                    currentY = Math.max(0, Math.min(currentY + incY, maxY));
                    if (currentY <= 0 || currentY == maxY) {
                        pauseScrolling();
View Full Code Here

      mMouseListener = new MyMouseListener();
      addMouseListener(mMouseListener);

      mActionListener = new MyActionListener();
      mTimer = new Timer(mRepeatDelay, mActionListener);
      mTimer.setInitialDelay(mInitialDelay);
    }
View Full Code Here

    setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER);

    component.setVisible(false);
    getViewport().setBackground(component.getBackground());

    timer = new Timer(delay, this);
  }
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.