diff --git a/src/main/java/ch/zhaw/gartenverwaltung/TutorialController.java b/src/main/java/ch/zhaw/gartenverwaltung/TutorialController.java index 521a3bc..c540a79 100644 --- a/src/main/java/ch/zhaw/gartenverwaltung/TutorialController.java +++ b/src/main/java/ch/zhaw/gartenverwaltung/TutorialController.java @@ -1,6 +1,7 @@ package ch.zhaw.gartenverwaltung; +import ch.zhaw.gartenverwaltung.io.PlantList; import javafx.fxml.FXML; import javafx.scene.control.Button; import javafx.scene.image.Image; @@ -8,6 +9,7 @@ import javafx.scene.image.ImageView; import javafx.scene.layout.StackPane; import javafx.stage.Stage; import java.io.File; +import java.io.InputStream; /** * Controller class for the Tutorial.fxml file @@ -46,10 +48,10 @@ public class TutorialController { * @param fileName the file name of the source */ private void setImageView(ImageView imageView, String fileName) { - File file = new File(String.valueOf(PlantsController.class.getResource(fileName))); + InputStream is = PlantsController.class.getResourceAsStream("screenshots/" + fileName); Image image; - if (file.exists()) { - image = new Image(String.valueOf(PlantsController.class.getResource(fileName))); + if (is != null) { + image = new Image(String.valueOf(PlantsController.class.getResource("screenshots/" + fileName))); } else { image = new Image(String.valueOf(PlantsController.class.getResource("placeholder.png"))); } diff --git a/src/main/resources/ch/zhaw/gartenverwaltung/add-new-plant.png b/src/main/resources/ch/zhaw/gartenverwaltung/screenshots/add-new-plant.png similarity index 100% rename from src/main/resources/ch/zhaw/gartenverwaltung/add-new-plant.png rename to src/main/resources/ch/zhaw/gartenverwaltung/screenshots/add-new-plant.png diff --git a/src/main/resources/ch/zhaw/gartenverwaltung/add-task.png b/src/main/resources/ch/zhaw/gartenverwaltung/screenshots/add-task.png similarity index 100% rename from src/main/resources/ch/zhaw/gartenverwaltung/add-task.png rename to src/main/resources/ch/zhaw/gartenverwaltung/screenshots/add-task.png diff --git a/src/main/resources/ch/zhaw/gartenverwaltung/details-delete.png b/src/main/resources/ch/zhaw/gartenverwaltung/screenshots/details-delete.png similarity index 100% rename from src/main/resources/ch/zhaw/gartenverwaltung/details-delete.png rename to src/main/resources/ch/zhaw/gartenverwaltung/screenshots/details-delete.png diff --git a/src/main/resources/ch/zhaw/gartenverwaltung/schedule.png b/src/main/resources/ch/zhaw/gartenverwaltung/screenshots/schedule.png similarity index 100% rename from src/main/resources/ch/zhaw/gartenverwaltung/schedule.png rename to src/main/resources/ch/zhaw/gartenverwaltung/screenshots/schedule.png diff --git a/src/main/resources/ch/zhaw/gartenverwaltung/select-sow-harvest.png b/src/main/resources/ch/zhaw/gartenverwaltung/screenshots/select-sow-harvest.png similarity index 100% rename from src/main/resources/ch/zhaw/gartenverwaltung/select-sow-harvest.png rename to src/main/resources/ch/zhaw/gartenverwaltung/screenshots/select-sow-harvest.png