I have a JFrame with a button on it. When the user presses the button, a time consuming series of actions are performed. I have a JLabel on the form that says "Please wait" that I want to become visible while the actions are being performed and then go invisible when they are completed. So, I put label.setVisible(true)
at the beginning of the action listener and label.setVisible(false)
at the end, but nothing happens.
It seems like the displaying of the label was being queued until the actions were finished, so it just goes visible and then immediately invisible. How can I make sure the label becomes visible before continuing with the rest of the code in the action listener?