> I have created some code that manipulated some figures but I would like
> the code to run evey 10 seconds.
> I know this is easy for some but I am new to Java.
> Please help.
>
> Simon.
http://java.sun.com/j2se/1.4.2/docs/api/java/util/Timer.html
If you need to do this in a Gui, you might want to look at
http://java.sun.com/j2se/1.4.2/docs/api/javax/swing/Timer.html

Signature
Kind regards,
Christophe Vanfleteren
Simon Teff - 12 Apr 2004 18:26 GMT
Thanks for the reply. Do you have an example of real coding.
Simon.
> > I have created some code that manipulated some figures but I would like
> > the code to run evey 10 seconds.
[quoted text clipped - 7 lines]
> If you need to do this in a Gui, you might want to look at
> http://java.sun.com/j2se/1.4.2/docs/api/javax/swing/Timer.html
>I have created some code that manipulated some figures but I would like the
>code to run evey 10 seconds.
If you want a task to be run at some time in the future or repeatedly
at regular intervals, you can schedule it with the java.util.Timer
class. See also javax.swing.Timer.
They are pretty straightforward once you understand Threads.
see http://mindprod.com/jgloss/thread.html
--
Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming.
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.