• Post Reply Bookmark Topic Watch Topic
  • New Topic

Timer  RSS feed

 
Parth Sagdeo
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello again,
I was wondering, is there and way to call on a certain method every x seconds? I was going to use it for a program similiar to the "snake" program on most nokia cell phones, to call on the paint method of a JApplet every second. Thanks for any help you can give me!
Sincerely,
Parth
 
Tim West
Ranch Hand
Posts: 539
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The subject line of your post names the class you want to look at
Check out the Timer class in the API at http://java.sun.com/j2se/1.4.2/docs/api/.
If you're not familiar with threads you may want to get a grounding on the fundamentals, though the Timer class does abstract a lot of the nastiness of multithreading quite nicely.

-Tim
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!