• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Timer

 
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 539
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
reply
    Bookmark Topic Watch Topic
  • New Topic