Hey guys. I�m trying to use a timer (package java.util.Timer and java.util.TimerTask) and I want the timer to be triggered from a button. Not just from the method �schedule� .
Now here is a program which I was trying to execute but it keeps giving me errors... (
IllegalStateException)
/***************************/
/********************************************/
Now whenever I try to click on the button(whether the timer is running or after it has ran out), the NetBeans keeps giving me that error (Exception in
thread "AWT-EventQueue-0" java.lang.IllegalStateException: Timer already cancelled.). So appearantly the error is either in the 'actionPerformed' or 'run' methods.
Then i read in another post that i have to use a new timer since i cannot restart a canceled timer. I tried that and it doesn't work.
Any help would be appreciated.
[ November 02, 2005: Message edited by: Yousef Dardeer ]