I print some text and then I want to wait 2 seconds and print something else on the screen. I Googled around and everything seems like overkill using threads and invoking methods. I am sure there's a simpler way.
Here's what I tried:
public class Test extends Application {
@Override
public void start(Stage primaryStage) {
GridPane root = new GridPane();
primaryStage.setScene(new Scene(root, 1000, 1000));
Text text = new Text("bla");
root.getChildren().addAll(text);
primaryStage.show();
try {
Thread.sleep(2000);
}
catch(Exception e) {
}
root = new GridPane();
root.getChildren().addAll(new Text("adsasd"));
primaryStage.show();
}
public static void main(String[] args) {
Test.launch();
}
}