Advertisement

[java] timer in java

Started by May 20, 2001 09:39 AM
2 comments, last by warm0ng3r 23 years, 8 months ago
this is a pretty simple question and i think ive gotten tangled up in vapour here.... but htf do u set up a timer in java and use the values that the timer takes? dont have the documentation, its gonna take me a couple of nights to dl on my limited b/w... thnks anyhoot.... here in castle camelot we eat ham and jam and spam alot!
import javax.swing.Timer

then have something like

Timer timerVariable = new Timer(int (the timedelay in MILLISECONDS), an action listener)

if you had a class or something that you wanted to have a timer in just have the class implement actionlistener and for the actionlistener part of the constructor put THIS
Advertisement
i forgot to say that you have to also have a method that picks up everytime the timer goes off because it is an event.
cheerzors

here in castle camelot we eat ham and jam and spam alot!

This topic is closed to new replies.

Advertisement