Question

I have a message label and a submit button. The submit button will be pressed multiple times, and the action for the each press can take up to a minute.

When the button is pressed, I want to set the message to empty, and after the task is complete, I want to set the message to "Complete".

private void submitActionPerformed(java.awt.event.ActionEvent evt) {
   message = "";
   updateMessageLabel();

   doTheTask();

   /* this update is apply to the label after completion */
   message = "Complete";
}

Is it possible to update that message label before the submitActionPerformed() method is run (or in the method), but after the the button is clicked?

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top