Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / GUI / December 2003

Tip: Looking for answers? Try searching our database.

GUI countdown timer in a JApplet?

Thread view: 
Ryan Stewart - 23 Dec 2003 21:31 GMT
What would be the best way to go about creating a countdown timer that shows
the user how much time he/she has to accomplish something, then do something
(call a method or set a flag) when the time has run out? Imagine an applet
with a clock counting down in one corner or another. Would you use a thread
to update the clock? Have it sleep for 250 or 500 or 1000 milliseconds then
calculate the remaining time and display it? If so, then how do you do the
repaint? Pass the JApplet to the thread so it can call repaint()? That seems
messy to me. Or maybe have the thread fire an event which the applet listens
for? I guess if I were going to do that, then I could just use one of the
Timer classes. I can make it work, but I'd like to get some input on clean
and efficient ways to go about it.
Steven T Abell - 24 Dec 2003 17:27 GMT
> What would be the best way to go about creating a countdown timer that shows
> the user how much time he/she has to accomplish something, then do something
[quoted text clipped - 7 lines]
> Timer classes. I can make it work, but I'd like to get some input on clean
> and efficient ways to go about it.

BTDT. Use Timer.

Steve
nos - 24 Dec 2003 19:22 GMT
> > What would be the best way to go about creating a countdown timer that shows
> > the user how much time he/she has to accomplish something, then do something
[quoted text clipped - 11 lines]
>
> Steve

and 1000 ms for the interval


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.