Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Beginning Java
Search Coderanch
Advance search
Google search
Register / Login
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
Tim Cooke
paul wheaton
Paul Clapham
Ron McLeod
Sheriffs:
Jeanne Boyarsky
Liutauras Vilda
Saloon Keepers:
Tim Holloway
Carey Brown
Roland Mueller
Piet Souris
Bartenders:
Forum:
Beginning Java
delay time
Jing Liang
Ranch Hand
Posts: 40
posted 18 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hi guys,
I am looking for a method or class that can delay calling my method at a defined interval. Does anyone have an idea? Thanks
Ernest Friedman-Hill
author and iconoclast
Posts: 24207
46
I like...
posted 18 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Either the java.util.Timer or javax.swing.Timer class should do what you need.
[Jess in Action]
[AskingGoodQuestions]
Jing Liang
Ranch Hand
Posts: 40
posted 18 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Thanks Ernest
The javax.swing.Timer will call my method at every interval time but I only want it delay the time to call my method once. Do you know how could I fix this?
Michael Dunn
Ranch Hand
Posts: 4632
posted 18 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
> but I only want it delay the time to call my method once.
timer.setRepeats(false);
Jing Liang
Ranch Hand
Posts: 40
posted 18 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Thanks Michael
Consider Paul's
rocket mass heater
.
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
delay method
Timer
Threads: sleep() !
Synchronized methods
How to test Network mode?
More...