From 62a2751364a59e1c5e45e00e290cde3b3f828eec Mon Sep 17 00:00:00 2001 From: fdai7736 Date: Tue, 6 Feb 2024 20:23:26 +0100 Subject: [PATCH] add StartGame btn and switch to scene game --- .../java/de/hsfulda/onses/controllers/AppController.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/java/de/hsfulda/onses/controllers/AppController.java b/src/main/java/de/hsfulda/onses/controllers/AppController.java index d1eb5b4..14d8c1c 100644 --- a/src/main/java/de/hsfulda/onses/controllers/AppController.java +++ b/src/main/java/de/hsfulda/onses/controllers/AppController.java @@ -28,7 +28,13 @@ public class AppController implements Controller { final Parent parent = FXMLLoader.load(Objects.requireNonNull(Main.class.getResource("views/app.fxml"))); Button button = (Button) parent.lookup("#startGameBtn"); - + button.setOnAction(e -> { + try { + stage.setScene(new Scene(gameController.render())); + } catch (IOException ex) { + throw new RuntimeException(ex); + } + }); return parent; } }