Hi folks. I have the following lines of code:
query.setBackground(Color.RED);
try
{
Thread.sleep(1000);
}
catch(InterruptedException e)
{
System.out.println(e);
}
query.setBackground(Color.WHITE);
the object query is a JTextField. I want to be able to get the background of query to flash red for one second then revert back to white background. I have tried using javax.swing.Timer to do this, and have even tried using an actual thread class as opposed to above but none of these options have worked. Instead my GUI locks for the whole second and I still have a white background in the text field.
Hope someone knows the answer to this! I want to get to bed before 4am... currently 330am... ugghhh.... lol
Jason.