Hey guys,
I've figured out the way to use Timer properly in order to decrease the speed of your animation! Refer to the sample code in this following link: http://forum.java.sun.com/thread.jspa?threadID=5140432&messageID=9516333
Pay attention at the way he uses the Timer. The constructor takes two arguments: period of the delay (in milliseconds) and the object itself (this). The Timer is started in the constructor of the public class. Then he put a handler in the actionPerformed method. Each time the delay period is up, the codes inside the actionPerformed method will be run!
Good luck on your assignment!
Cheers
I've figured out the way to use Timer properly in order to decrease the speed of your animation! Refer to the sample code in this following link: http://forum.java.sun.com/thread.jspa?threadID=5140432&messageID=9516333
Pay attention at the way he uses the Timer. The constructor takes two arguments: period of the delay (in milliseconds) and the object itself (this). The Timer is started in the constructor of the public class. Then he put a handler in the actionPerformed method. Each time the delay period is up, the codes inside the actionPerformed method will be run!
Good luck on your assignment!
Cheers