This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Java Timer Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Java Timer" Watch "Java Timer" New topic

Java Timer

Meet Gaurav
Ranch Hand

Joined: Oct 08, 2008
Posts: 492

I need to start the timer from zero. Some please assist me

The new Date is starting it from System Date.

Rob Spoor

Joined: Oct 27, 2005
Posts: 19697

Check out the methods in javax.swing.Timer. There are two that can set two different delays. Call one of those.

How To Ask Questions How To Answer Questions
doruk turkoglu

Joined: May 22, 2009
Posts: 4
i really cant get question fully but if you want to display a date-time thing in panel or whatelse and want to start it from 0 (is it 01.01.2000 00:00) you should set time of your date with Date constructor
Campbell Ritchie

Joined: Oct 13, 2005
Posts: 39073
Check the API, but I think "0" means 1st January 1970.
Meet Gaurav
Ranch Hand

Joined: Oct 08, 2008
Posts: 492
This helps me.. thanks for all your reply

This will starts with 1 hr and ends with 0(I mean after 1 Hr). Reverse timer

GeeCON Prague 2014
subject: Java Timer