I have multiple Thread.sleep()'s in my code under a jButton actionevent evt.
In between these, I need to be able to update a jLabel, but for some reason it waits until the last thread.sleep() before it updates the jLabel.
Any ideas why?
private void jButtonActionPerformed(java.awt.event.ActionEvent evt) {
try {
Thread.sleep(1000);
jLabel.setText("Change Text To This");
Thread.sleep(1000);
} catch (InterruptedException ex) {}
}
So rather than waiting 1000ms, then update label, then wait another 1000ms, it just waits 2000ms, then updates the label
Please help!
Thanks