From 8a03439ab63d293a921ced5ce2ab6deae9b069ff Mon Sep 17 00:00:00 2001 From: pbg2h21ama Date: Tue, 31 Jan 2023 16:20:51 +0100 Subject: [PATCH] Registrierungsszwnenwechsel angepasst --- .../example/vpr_javafx/HelloController.java | 18 ++++-- .../example/vpr_javafx/MenuOverview-view.fxml | 2 +- .../example/vpr_javafx/HelloController.class | Bin 10189 -> 11026 bytes .../example/vpr_javafx/MenuOverview-view.fxml | 2 +- .../example/vpr_javafx/Registration-view.fxml | 59 +++++++++--------- 5 files changed, 44 insertions(+), 37 deletions(-) diff --git a/src/main/java/com/example/vpr_javafx/HelloController.java b/src/main/java/com/example/vpr_javafx/HelloController.java index 62df7ee..0ae05dc 100644 --- a/src/main/java/com/example/vpr_javafx/HelloController.java +++ b/src/main/java/com/example/vpr_javafx/HelloController.java @@ -127,11 +127,11 @@ public class HelloController { @FXML - private String veggieImageUrl = "pics/vegetarisch.png"; + private String veggieImageUrl = "vegetarisch.png"; @FXML - private String veganUrl = "pics/vegan.png"; + private String veganUrl = "vegan.png"; @FXML - private String meatUrl = "pics/fleisch.png"; + private String meatUrl = "fleisch.png"; @FXML private String imageUrl; @@ -172,7 +172,7 @@ public class HelloController { imageUrl=veganUrl; } - Image image = new Image("C:/VPR_Projekt_Java/target/classes/com/example/vpr_javafx/" + imageUrl); + Image image = new Image("file:target/classes/com/example/vpr_javafx/pics/" + imageUrl); switch (i) { case 0: @@ -277,6 +277,16 @@ public class HelloController { + "8: Konservierungsstoff"); } + @FXML + protected void ToRegistration(ActionEvent event) throws IOException + { + Parent root = FXMLLoader.load(getClass().getResource("Registration-view.fxml")); + Stage stage = (Stage) ((Node) event.getSource()).getScene().getWindow(); + Scene scene = new Scene(root); + stage.setScene(scene); + stage.show(); + } + @FXML protected void OnRegistrationButton(ActionEvent event) throws IOException { diff --git a/src/main/resources/com/example/vpr_javafx/MenuOverview-view.fxml b/src/main/resources/com/example/vpr_javafx/MenuOverview-view.fxml index 83b1fdf..2bf9cb2 100644 --- a/src/main/resources/com/example/vpr_javafx/MenuOverview-view.fxml +++ b/src/main/resources/com/example/vpr_javafx/MenuOverview-view.fxml @@ -70,7 +70,7 @@