diff --git a/src/main/java/com/example/vpr_javafx/HelloController.java b/src/main/java/com/example/vpr_javafx/HelloController.java index 0ae05dc..20ec7bb 100644 --- a/src/main/java/com/example/vpr_javafx/HelloController.java +++ b/src/main/java/com/example/vpr_javafx/HelloController.java @@ -127,11 +127,13 @@ public class HelloController { @FXML - private String veggieImageUrl = "vegetarisch.png"; + final String imagePathUrl = "file:target/classes/com/example/vpr_javafx/pics/"; @FXML - private String veganUrl = "vegan.png"; + final String veggieImageUrl = imagePathUrl + "vegetarisch.png"; @FXML - private String meatUrl = "fleisch.png"; + final String veganImageUrl = imagePathUrl + "vegan.png"; + @FXML + final String meatImageUrl = imagePathUrl + "fleisch.png"; @FXML private String imageUrl; @@ -163,16 +165,16 @@ public class HelloController { String dayMenu = dish+"\n"+sideDish+"\n"+"("+allergenic+")"; if(typ.equals("Fleisch")) { - imageUrl=meatUrl; + imageUrl=meatImageUrl; } if(typ.equals("Vegetarisch")) { imageUrl=veggieImageUrl; } if(typ.equals("Vegan")) { - imageUrl=veganUrl; + imageUrl=veganImageUrl; } - Image image = new Image("file:target/classes/com/example/vpr_javafx/pics/" + imageUrl); + Image image = new Image(imageUrl); switch (i) { case 0: diff --git a/target/classes/com/example/vpr_javafx/HelloController.class b/target/classes/com/example/vpr_javafx/HelloController.class index 9500c67..3e7d74d 100644 Binary files a/target/classes/com/example/vpr_javafx/HelloController.class and b/target/classes/com/example/vpr_javafx/HelloController.class differ