Results 1 to 2 of 2
- 04-14-2010, 02:48 PM #1Member
- Join Date
- Apr 2010
- Rep Power
How to notify the completion of a process in SwingWorker to another class
I have an application in which I have an action class (GUI) that brings up a table (another class) with related data. Now the data for the table loaded from DB being too huge, needs to be done in a SwingWorker (doInBackground method). The table class is inherited by a number of other classes and has various other functions.
If I do some action in the GUI (say click on a button), it invokes a method in the corresponding table class and in here the SwingWorker does all the loading. Once loading is done, I need to notify the GUI class of the same to update some related gui. Any suggestions of how to connect from the done() method of SwingWorker in one class (say Class1) to another class (say Class2) is appreciated.
One possible way: add a PropertyChangeListener to the SwingWorker.
Last edited by Fubarable; 04-14-2010 at 06:43 PM.
- By firstname.lastname@example.org in forum AWT / SwingReplies: 7Last Post: 11-16-2009, 01:03 PM
- By gppme in forum Advanced JavaReplies: 4Last Post: 04-18-2009, 04:04 AM
- By bourn2lead in forum Advanced JavaReplies: 1Last Post: 02-26-2009, 11:53 PM
- By iceflyin in forum New To JavaReplies: 8Last Post: 04-21-2008, 01:07 PM
- By erdaffi in forum NetBeansReplies: 0Last Post: 12-11-2007, 01:48 PM