Re: Question about thread
What happened when you tried? Also, you shouldn't have empty catch clauses. You're probably ignoring error messages that could help you understand what's going on.
You might want to use a Swing Timer instead of a thread. Updating the GUI on a thread other than the EDT is a big no-no.
Re: Question about thread
When I tried the program the first time it throw "java.lang.IllegalThreadStateException" ,
so that I tried to put it in a try catch blocks but I didn't know what to write in the Catch blocks so I left them empty !
the program works fine , but I don't know if this code is right or wrong !
thank you KevinWorkman :)
Re: Question about thread
Sounds like you found out that you can't call Thread.start() more than once, which the API tells you: Thread (Java Platform SE 6)
By surrounding it by a try and a catch, you're simply ignoring the error. That's not the right thing to do.
But you shouldn't be using multiple threads to interact with the GUI like this anyway. Use a Swing Timer instead.
Re: Question about thread
That what I wanted to know :)
Thank you so much KevinWorkman for your help :)