I have multiple classes extending the SwingWorker. What I wish to accomplish is to execute each class one after another (without executing the next class in the previous class' done method). For example, lets say I have:
ClassSwingW1 csw1 = new ClassSwingW1();
csw1.execute;
ClassSwingW2 csw2 = new ClassSwingW2();
csw2.execute;
ClassSwingW3 csw3 = new ClassSwingW3();
csw3.execute;
and etc.
public class ClassSwingW1 extends SwingWorker<Void, Void> {
@Override
protected Void doInBackground() throws Exception {
//do something
return null;
}
}
public class ClassSwingW2 extends SwingWorker<Void, Void> {
@Override
protected Void doInBackground() throws Exception {
//do something
return null;
}
}
public class ClassSwingW3 extends SwingWorker<Void, Void> {
@Override
protected Void doInBackground() throws Exception {
//do something
return null;
}
}
I want the csw2 to execute after csw1 is done, and csw3 to execute after csw2 is done. I do not want them
executing at the same time. How would I accomplish this? Thank you
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…