Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package Ex4;
- import fyw.turtles.*;
- import java.awt.event.*;
- import javax.swing.Timer;
- public class TestTimerTurtle {
- public static void main(String[] args){
- Turtle t = new Turtle();
- new TurtleGUI(t);
- RandomTurtleController c = new RandomTurtleController(t);
- int delay = 300; //milliseconds
- ActionListener taskPerformer = new ActionListener() {
- public void actionPerformed(ActionEvent evt) {
- //...Perform a task...
- }
- };
- new Timer(delay, taskPerformer).start();
- }
- }
Add Comment
Please, Sign In to add comment