From 96fdc641058653a8acf28301066a5476ca28836c Mon Sep 17 00:00:00 2001 From: giavaphi Date: Sat, 5 Nov 2022 17:55:25 +0100 Subject: [PATCH] #36 update size of imageView --- .../ch/zhaw/gartenverwaltung/PlantsController.java | 7 +++++-- .../resources/ch/zhaw/gartenverwaltung/Plants.fxml | 13 ++----------- 2 files changed, 7 insertions(+), 13 deletions(-) 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 @@ - - - - - - - - - + +