I play with multitreading for SwingWorker by using Executor, and I\'m there by mistake identified wrong elements from the Vector, looks like as this code pretty ignores that
I think the problem you're running into is that exceptions caught in the background thread are only re-thrown if you call get()
when processing is complete. This seems to be a common problem with SwingWorker.
You can change your done()
function to:
@Override
protected void done() {
if (str.equals("StartShedule")) {
try {
get();
}
catch (Exception ex) {
// This exception was thrown during processing
ex.printStackTrace();
}
}
}
done()
gets executed on the event dispatch thread so you can display any error messages you need to from there. I hope that helps some.