Guest User

Untitled

a guest
Jul 17th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. package Ex4;
  2. import fyw.turtles.*;
  3. import java.awt.event.*;
  4. import javax.swing.Timer;
  5.  
  6.  
  7. public class TestTimerTurtle {
  8. public static void main(String[] args){
  9.  
  10. Turtle t = new Turtle();
  11. new TurtleGUI(t);
  12. RandomTurtleController c = new RandomTurtleController(t);
  13. int delay = 300; //milliseconds
  14. ActionListener taskPerformer = new ActionListener() {
  15. public void actionPerformed(ActionEvent evt) {
  16. //...Perform a task...
  17. }
  18. };
  19. new Timer(delay, taskPerformer).start();
  20. }
  21. }
Add Comment
Please, Sign In to add comment