I need to change jlabel.text several times by one click button in swing. In this code i need set label text to start before dowork() function and set to in progress in middle and set it to end after dowork() (status type in jlabel and dowork has long time execution) :
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
status.setText("start");
try {
Thread.sleep(10000);
} catch (InterruptedException ex) {
Logger.getLogger(PelakInRFID.class.getName()).log(Level.SEVERE, null, ex);
}
status.setText("in progress");
dowork();
try {
Thread.sleep(10000);
} catch (InterruptedException ex) {
Logger.getLogger(PelakInRFID.class.getName()).log(Level.SEVERE, null, ex);
}
status.setText("end");
}
In this code status only set to end and start doesn't show.