Countdown

Reply

Join Date: Aug 2004
Posts: 780
Reputation: OurNation is an unknown quantity at this point 
Solved Threads: 9
OurNation's Avatar
OurNation OurNation is offline Offline
Master Poster

Countdown

 
0
  #1
Sep 25th, 2004
Is it possible to make a timer that counts down to a cerrtin day and time also is it possible to make it display some where but not in the way
PETA People for the Eating of Tasty Animals.


FireFox
Hijack This
Ad-Aware
Hijack this tutorial
Microsoft AntiSpyware
CompUchat
Reply With Quote Quick reply to this message  
Join Date: Jul 2004
Posts: 1,749
Reputation: nanosani is an unknown quantity at this point 
Solved Threads: 54
Team Colleague
nanosani's Avatar
nanosani nanosani is offline Offline
Unauthenticated Liar

Re: Countdown

 
0
  #2
Sep 25th, 2004
Originally Posted by OurNation
to make it display some where but not in the way
what does this mean ????
where do you want it to be displayed ??

if I were coding ... I would have put it in the startup and check for date and time ( Calendar class) everysecond or so ... and then set it visible on the specified time.
Reply With Quote Quick reply to this message  
Join Date: Aug 2004
Posts: 153
Reputation: cosi is an unknown quantity at this point 
Solved Threads: 1
cosi's Avatar
cosi cosi is offline Offline
Junior Poster

Re: Countdown

 
0
  #3
Oct 8th, 2004
Hey OurNation,

Yes it is possible.

The straightforward way to find the difference in time is to simply use Date().getTime() for time in milliseconds. Just subtract the current date in millisecs from the future date in millisecs. It may also possible to use Calendar.add() to find the difference in time.

I have two suggestions for keeping the information out of the way of your workspace.

Approach #1)
You could make a program that updates the frame title with the message (i.e. 2 days left). This app doesn't have to have a visible frame, or the app could start minimized. This is probably the easiest out-of-the-way approach for a countdown timer.

Approach #2)
Use a trayicon to display the information. This requires some os shell programming, but luckily there are many people who have already written code to do this. (http://jeans.studentenweb.org/java/t.../trayicon.html)

Hope this helps!


Ed
In a world without walls or fences,
What use are Windows and Gates.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Java Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC