title: Java: Timer (wait x seconds)
body: <p>I have a simple GUI that can save and get some data out of an .doc file.</p>
  
  <p>When i press a save button, i have a label that says "Succes" or "Error" via label.setText();</p>
  
  <p>Update: The code is meant to be ran in a FXMLDocumentController (built på SceneBuilder)</p>
  
  <p>I want the label to go back to being empty ("") after 3 seconds..</p>
  
  <p>I have tried:</p>
  
  <pre><code>try {
      Thread.sleep(1000);               
      } 
   catch(InterruptedException ex) {
  Thread.currentThread().interrupt();
  </code></pre>
  
  <p>}</p>
  
  <p>but is it like, that the sleep-function freezes the whole GUI so i can't interact with it while it's sleeping. How do i set up an timer that does not affect usability? :)</p>