Guest User

Untitled

a guest
Jul 4th, 2014
347
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. public class Time {
  2.  
  3. ActionListener action = new ActionListener(){
  4. @Override
  5. public void actionPerformed(ActionEvent e) {
  6. count += 1;
  7. //System.out.println(count);
  8. if(count > 1){
  9. t.stop();
  10. }
  11. }
  12.  
  13. };
  14. public Timer t = new Timer(2000, action);
  15. public int count;
  16. public void start(){
  17. t.start();
  18. }
  19. public void stop(){
  20. t.stop();
  21. }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment