finished = b;
}
@Override
public void run() {
final ProgressDialog dlg = new ProgressDialog(title);
while (!finished && thread.isAlive()) {
SwingUtilities.invokeLater(
new Thread(new Runnable() {
@Override
public void run() {
dlg.update();
}
}));
try { sleep(10); } catch (Exception ignore) {}
}
SwingUtilities.invokeLater(
new Thread(new Runnable() {
@Override
public void run() {
dlg.close();
}
}));
thread = null;
}