You are sleeping on the UI thread which blocks any further processing (including refreshing the screen).
If you need to delay some code you can use a PauseTransition to wait for two seconds and use its onFinished method to run the rest of your code after the wait.