package bugreport; import javafx.application.Application; import javafx.event.ActionEvent; import javafx.event.EventHandler; import javafx.geometry.Rectangle2D; import javafx.scene.Group; import javafx.scene.Scene; import javafx.scene.control.Button; import javafx.scene.paint.Color; import javafx.stage.Screen; import javafx.stage.Stage; public class BugReport extends Application { Stage stage; public static void main(String[] args) { Application.launch(args); } @Override public void start(Stage primaryStage) { stage = primaryStage; Rectangle2D screenBounds = Screen.getPrimary().getVisualBounds(); primaryStage.setFullScreen(true); Group root = new Group(); Group root2 = new Group(); final Scene scene1 = new Scene(root, Color.BLUE); final Scene scene2 = new Scene(root2, Color.RED); Button btn = new Button(); btn.setText("New Scene"); btn.setLayoutX(screenBounds.getWidth() / 2); btn.setLayoutY(screenBounds.getHeight() / 2); btn.setOnAction(new EventHandler() { public void handle(ActionEvent event) { stage.setScene(scene2); } }); root.getChildren().add(btn); stage.setScene(scene1); primaryStage.show(); } private void setStage(Scene aScene){ stage.setScene(aScene); } }