• Post Reply Bookmark Topic Watch Topic
  • New Topic

Usage between SwingWorker and Thread classes  RSS feed

 
Karthik Kannan
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
We are developing a network management desktop application using Java Swing. Obviously, the network operations are done as separate threads. I doubt whether we can use the ordinary Thread class for implementing the threads, or to use SwingWorker thread.

My Questions are:
B]When to use SwingWorker class and Thread class? What is the purpose of SwingWorker when we have Thread class?[/B]

Thanks and Regards,
Karthik Kannan.
 
Joe Ess
Bartender
Posts: 9426
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As this article states:
SwingWorker does all the dirty work of implementing a background thread.
One would use SwingWorker in the same circumstances one would use Thread, it's just an easier way to go about it.
BTW, read the above article CAREFULLY. It covers a great deal about Swing and threading. You can avoid a lot of headaches by getting a little knowledge beforehand.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!