• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Java How Multiple instances of SwingWorker runs parallel with GUI processes

 
Greenhorn
Posts: 6
MyEclipse IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Java How Multiple instances of SwingWorker runs parallel with GUI processes

I have a class, FileTransfer which extends SwingWorker. I am creating an object of FileTransfer on button click event and execute the fileTransfer Threaed and it runs doInBackground() method of
FileTransfer which starts the file trasfter process , in case of multiple files or big file I select another source to trasfter the file, FileTrasfer new instace is created but it will not work because of SwingWorker thread is already in running , My problem is that I want to execute seprate thread on button click using Swing Worker because I have currently working in Desktop GUI if we use our own Thread class then GUI Process and Background Process does not work properly, So I want a solution in which Multiple SwingWorker instance run parallel so GUI process will not disturb.
here given template how I am working ….
Public void actionPerformed(ActionEvent ae)
{
If(ae.getActionCommand == “FileTransfter”)
{
FileTransfer fileTransfer = new FileTransfer();
fileTransfer.execute();
}
}

class FileTransfer extends SwingWorker
{
public Boolean fileTransfer()
{
// File Transfer code is here…
}
protected Object doInBackground() throws Exception
{
fileTransfer ();
return null;
}
}

Thanks..
 
Do not threaten THIS beaver! Not even with this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic