View Single Post
  #3 (permalink)  
Old 07-20-2007, 01:59 PM
lacoste lacoste is offline
Member
 
Join Date: Jul 2007
Posts: 3
lacoste is on a distinguished road
Ahh thank you sir. Im just having a hard time in net beans, so I thought this was not possible.

About the last one:
Quote:
Originally Posted by JavaBean View Post
Yes, keep the number of seconds remaining in a variable and decrease it every seconds! You can call Thread.sleep(X) method to sleep X number of milliseconds.

You can keep the above variable in your thread and decrease its value and call a method to update the representation. For example representation can be a JLabel and you can call its setText() method in your update method!
I may be wrong but isn't this a code that tells the thread to stop like when the times up the thread close like destroy();?
Reply With Quote