package test.scenegraph.app;
import javafx.animation.Animation;
import javafx.animation.FadeTransitionBuilder;
import javafx.animation.KeyFrame;
import javafx.animation.KeyValue;
import javafx.animation.ParallelTransition;
import javafx.animation.PathTransition;
import javafx.animation.PauseTransition;
import javafx.animation.SequentialTransition;
import javafx.animation.Timeline;
import javafx.animation.TranslateTransitionBuilder;
import javafx.application.Application;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.scene.Group;
import javafx.scene.Node;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.ButtonBuilder;
import javafx.scene.shape.LineTo;
import javafx.scene.shape.MoveTo;
import javafx.scene.shape.Path;
import javafx.scene.shape.Rectangle;
import javafx.stage.Stage;
import javafx.stage.StageBuilder;
import javafx.util.Duration;

public class ShortAppWithoutDependencies5111 extends Application {
  public static void main(String[] args) {
        launch(args);
    }
@Override public void start(final Stage primaryStage) throws Exception {
        Button switchOver = ButtonBuilder.create().text("Switch").onAction(new EventHandler<ActionEvent>() {
            @Override public void handle(ActionEvent event) {
                primaryStage.close();
                Stage other = StageBuilder.create().height(100).width(100).build();
                other.show();
            }
        }).build();

        //Stage zzz = StageBuilder.create().height(200).width(200).scene(new Scene(new Group(switchOver))).visible(true).applyTo(primaryStage);
        primaryStage.setHeight(200);
        primaryStage.setWidth(200);
        primaryStage.setScene(new Scene(new Group(switchOver)));
        primaryStage.show();

//        StageBuilder.create().height(200).width(200).scene(new Scene(new Group(switchOver))).applyTo(primaryStage);
    }
}