Guest User

Untitled

a guest
Jul 18th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  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() );
Add Comment
Please, Sign In to add comment