title: stop for X seconds before running next function in JAVA FXML (using SCENEBUILDER)
body: <p>I've used Scenebuilder to place few shapes in my GUI (simplified version of my project). I would like the shapes to change colours but wait 2 seconds between changing colours. I want these changes to happen in my controller class after a button is pressed.</p>
  
  <pre><code>Circle1.setFill(YELLOW)
  Wait(2 seconds)
  Circle2.setFill(BLUE)
  </code></pre>
  
  <p>I'm not sure how to do that. I have read online about threading, but I don't really understand how to implement that from my Main and into my Controller class. Also, I could not really find any examples online. My Main class looks like: </p>
  
  <pre><code>public class Main extends Application {
      public static void main(String[] args) {
          launch(args);
      }
  
      @Override
      public void start(Stage primaryStage) throws Exception {
          BorderPane root = (BorderPane)FXMLLoader.load(getClass().getResource("File.fxml"));
          Scene scene = new Scene(root);
          scene.getStylesheets().add(getClass().getResource("application.css").toExternalForm());
          primaryStage.setScene(scene);
          primaryStage.show();    
      }
  }
  </code></pre>
  
  <p>Please help. Also, if you could provide an example would be helpful for me to understand as I could not really find one online that gives an example of this.</p>