This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
I have a small program which uses a timer and timer task package.. the program works fine.. but the problem is that as the time elapses i want to show the hour minutes and seconds .. is there a way to print it.. The program is as follows... =========================================================================== package com.mylib.olrt.Timer; import java.util.Timer; import java.util.TimerTask; import java.awt.Toolkit;
Basically, you will have to code it. Currently, you are using Timer to schedual a single event at a particular time. You will now have to schedule a repeating event, every second or so. This new event will now simply print the interium results, if the final time haven't been reached. And do what it did before, if the time has been reached (just don't forget to cancel the event).