diff --git a/code/FXML-Calculator/src/main/java/ch/zhaw/prog2/fxmlcalculator/MainWindowController.java b/code/FXML-Calculator/src/main/java/ch/zhaw/prog2/fxmlcalculator/MainWindowController.java index fd1a0d7..1468c22 100644 --- a/code/FXML-Calculator/src/main/java/ch/zhaw/prog2/fxmlcalculator/MainWindowController.java +++ b/code/FXML-Calculator/src/main/java/ch/zhaw/prog2/fxmlcalculator/MainWindowController.java @@ -118,6 +118,11 @@ public class MainWindowController { @Override public void update() { results.setText(valueHandler.getResultBound()); + if(valueHandler.areValuesOk()){ + results.setBorder(new Border(new BorderStroke(Color.GREEN, BorderStrokeStyle.SOLID, CornerRadii.EMPTY, new BorderWidths(1)))); + }else { + results.setBorder(new Border(new BorderStroke(Color.RED, BorderStrokeStyle.SOLID, CornerRadii.EMPTY, new BorderWidths(1)))); + } } }); } diff --git a/code/FXML-Calculator/src/main/java/ch/zhaw/prog2/fxmlcalculator/ResultWindowController.java b/code/FXML-Calculator/src/main/java/ch/zhaw/prog2/fxmlcalculator/ResultWindowController.java index bce37fd..c92142f 100644 --- a/code/FXML-Calculator/src/main/java/ch/zhaw/prog2/fxmlcalculator/ResultWindowController.java +++ b/code/FXML-Calculator/src/main/java/ch/zhaw/prog2/fxmlcalculator/ResultWindowController.java @@ -2,6 +2,8 @@ package ch.zhaw.prog2.fxmlcalculator; import javafx.fxml.FXML; import javafx.scene.control.TextArea; +import javafx.scene.layout.*; +import javafx.scene.paint.Color; import javafx.stage.Stage; /** @@ -30,6 +32,11 @@ public class ResultWindowController { @Override public void update() { results.setText(valueHandler.getResultBound()); + if(valueHandler.areValuesOk()){ + results.setBorder(new Border(new BorderStroke(Color.GREEN, BorderStrokeStyle.SOLID, CornerRadii.EMPTY, new BorderWidths(1)))); + }else { + results.setBorder(new Border(new BorderStroke(Color.RED, BorderStrokeStyle.SOLID, CornerRadii.EMPTY, new BorderWidths(1)))); + } } }); }