Hi ,
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;
public class TimerBean {
Timer timer;
Toolkit toolkit;
public TimerBean(int seconds)
{
timer=new Timer();
toolkit = Toolkit.getDefaultToolkit();
timer.schedule(new schedtask(),seconds*1000);
}
class schedtask extends TimerTask
{
public void run()
{
toolkit.beep();
System.out.println("Time's up!");
timer.cancel();
}
}
}
===========================================================================
package com.mylib.olrt.Timer;
public class Timertest
{
public static void main(
String args[])
{
TimerBean tb=new TimerBean(5);
System.out.println("TAsk Scheduled!");
}
}
=============================================================================
Thank you
Regards
[ April 05, 2006: Message edited by: Ranganath .S.Junpal ]