I am wanting my error messages to display in a JLabel temporarily, then set the text back to "". But instead it looks like it just skips over setting the message. I've stepped through the code and found it's setting the text, but it isn't displaying for some reason. I've even tried the repaint() method, but still nothing. Any help would be greatly appreciated.
Here's what I have:
public void displayError(String msg){
int ctr = 0;
while(ctr<2){
try {
lblError.setText(msg);
lblError.repaint();
Thread.sleep(500);
} catch (Exception e) {}
ctr++;
}
lblError.setText("");
}