startAndEndRoundButton.setText(testString);
try
{
TimeUnit.SECONDS.sleep(5); // how long each number stays up to be memorized;
}
catch (InterruptedException e)
{
}
startAndEndRoundButton.setText("Click to submit guess");
I would expect testString to display for 5 seconds and then "Click to submit guess" to display. Instead it pauses for 5 seconds and then displays "Click to submit guess"
What is the mechanism that is causing this and can I do anything to fix it?
Tagged as multithreading because it seems that sleep is used a fair bit in threading things, even though this is a simple single thread program.