Thread: flicker
View Single Post
  #4 (permalink)  
Old 01-15-2008, 12:52 AM
tim's Avatar
tim tim is offline
Senior Member
 
Join Date: Dec 2007
Location: South Africa
Posts: 334
tim is on a distinguished road
Quote:
Originally Posted by afsina View Post
tim: i think this is a bad idea to use Threads in Swing-AWT applications like that. you dont need to make your class extending a "Thread " for only using the sleep method. Thread.sleep() can be used arbitrarily in any class. Of course, this is not the best solution for the problem. Original pster may want to check the Swing Timers, or other timer facilities.
It depends on the programmer's style how he or she wants to implement threading. Many other programmers and books use this method. I, however, prefer to implement the Runnable interface. I understand what you mean by extending swing or AWT components as I have encountered threading problems in other languages like Borland Delphi.

Thank you
__________________
If your ship has not come in yet then build a lighthouse.
Reply With Quote