import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.ProgressIndicator;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;

public class SimpleProgressIndicator extends Application {

    @Override public void start(Stage stage) {
        stage.setTitle("Simple ProgressIndicator");

        VBox root = new VBox();
        Scene scene = new Scene(root, 300, 200);

        // If the scene is set on the stage here, the ProgressIndicator will not animate
        stage.setScene(scene);

        ProgressIndicator progInd = new ProgressIndicator();
        root.getChildren().add(progInd);

        // If the scene is set on the stage here, the ProgressIndicator animates fine
//        stage.setScene(scene);

        stage.show();
    }

    public static void main(String[] args) {
        Application.launch(args);
    }
}
