Scheduling Swingworker threads
Posted
by Simonw
on Stack Overflow
See other posts from Stack Overflow
or by Simonw
Published on 2009-05-27T14:00:29Z
Indexed on
2010/04/12
5:13 UTC
Read the original article
Hit count: 485
Hi,
I have a 2 processes to perform in my swing application, one to fill a list, and one to do operations on each element on the list. I've just moved the 2 processes into Swingworker threads to stop the GUI locking up while the tasks are performed, and because I will need to do this set of operations to several lists, so concurrency wouldn't be a bad idea in the first place. However, when I just ran
fillList.execute();
doStuffToList.execute();
the doStuffToList thread to ran on the empty list (duh...). How do I tell the second process to wait until the first one is done? I suppose I could just nest the second process at the end of the first one, but i dunno, it seems like bad practice.
© Stack Overflow or respective owner