daily pastebin goal
31%
SHARE
TWEET

Untitled

a guest Jul 18th, 2018 57 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package timertest;
  2. import javax.swing.Timer;
  3. import java.awt.event.*;
  4.  
  5. public class TimerTest
  6. {
  7.  
  8.    public static void main( String args[] )
  9.    {
  10.    int delay = 1000; //milliseconds
  11.  
  12.    ActionListener taskPerformer = new ActionListener()
  13.       {
  14.       public void actionPerformed(ActionEvent evt)
  15.          {
  16.          System.out.println( "test" );
  17.          }
  18.       };
  19.  
  20.    Timer test = new Timer(delay, taskPerformer);
  21.  
  22.    test.start();
  23.  
  24.    System.out.println( test.isRunning() );
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top