Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package timertest;
- import javax.swing.Timer;
- import java.awt.event.*;
- public class TimerTest
- {
- public static void main( String args[] )
- {
- int delay = 1000; //milliseconds
- ActionListener taskPerformer = new ActionListener()
- {
- public void actionPerformed(ActionEvent evt)
- {
- System.out.println( "test" );
- }
- };
- Timer test = new Timer(delay, taskPerformer);
- test.start();
- System.out.println( test.isRunning() );
Add Comment
Please, Sign In to add comment