diff --git a/src/main/java/ch/zhaw/gartenverwaltung/PlantsController.java b/src/main/java/ch/zhaw/gartenverwaltung/PlantsController.java index 0d4764e..9ae9b4c 100644 --- a/src/main/java/ch/zhaw/gartenverwaltung/PlantsController.java +++ b/src/main/java/ch/zhaw/gartenverwaltung/PlantsController.java @@ -232,6 +232,11 @@ public class PlantsController implements Initializable { * image of the plant */ private void lookForSelectedListEntry() { + selectedPlant = null; + description_plant.setText(""); + selectSowDay_button.setDisable(true); + Image img = new Image(String.valueOf(PlantsController.class.getResource("placeholder.png"))); + img_plant.setImage(img); list_plants.getSelectionModel().selectedItemProperty().addListener(new ChangeListener() { @Override public void changed(ObservableValue observable, Plant oldValue, Plant newValue) { @@ -246,8 +251,6 @@ public class PlantsController implements Initializable { img = new Image(String.valueOf(PlantsController.class.getResource("placeholder.png"))); } img_plant.setImage(img); - - } else { selectedPlant = null; description_plant.setText(""); diff --git a/src/main/resources/ch/zhaw/gartenverwaltung/Plants.fxml b/src/main/resources/ch/zhaw/gartenverwaltung/Plants.fxml index 4341e7b..18af41a 100644 --- a/src/main/resources/ch/zhaw/gartenverwaltung/Plants.fxml +++ b/src/main/resources/ch/zhaw/gartenverwaltung/Plants.fxml @@ -1,14 +1,12 @@ - - @@ -33,15 +31,8 @@ - - - - - - - - - + +