943,523 Members | Top Members by Rank

Ad:
  • Java Discussion Thread
  • Unsolved
  • Views: 4071
  • Java RSS
Sep 25th, 2004
0

Countdown

Expand Post »
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
Similar Threads
Reputation Points: 16
Solved Threads: 9
Master Poster
OurNation is offline Offline
780 posts
since Aug 2004
Sep 25th, 2004
0

Re: Countdown

Quote 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.
Team Colleague
Reputation Points: 45
Solved Threads: 56
Unauthenticated Liar
nanosani is offline Offline
1,767 posts
since Jul 2004
Oct 8th, 2004
0

Re: Countdown

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
Reputation Points: 17
Solved Threads: 1
Junior Poster
cosi is offline Offline
153 posts
since Aug 2004

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Java Forum Timeline: doubly linked list implementation
Next Thread in Java Forum Timeline: Can someone tell me what i am doing wrong?





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC