I am just wondering if the following code is correct. I have a SwingWorker that does something, sleeps, does something else and updates GUI. Is it okay to use Thread.sleep inside SwingWorker?
class MySwingy extends SwingWorker<Void, Void> {
@Override
public Void doInBackground() {
//Do Something
try {
Thread.sleep(200);
} catch (Exception ex) {
}
//Do Something
}
@Override
public void done() {
//Update GUI
}
}