Aufgabe 4 angepasst.

This commit is contained in:
romanschenk37 2022-03-30 13:36:53 +02:00
parent dce3387032
commit 242d035756
2 changed files with 12 additions and 0 deletions

View File

@ -118,6 +118,11 @@ public class MainWindowController {
@Override @Override
public void update() { public void update() {
results.setText(valueHandler.getResultBound()); 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))));
}
} }
}); });
} }

View File

@ -2,6 +2,8 @@ package ch.zhaw.prog2.fxmlcalculator;
import javafx.fxml.FXML; import javafx.fxml.FXML;
import javafx.scene.control.TextArea; import javafx.scene.control.TextArea;
import javafx.scene.layout.*;
import javafx.scene.paint.Color;
import javafx.stage.Stage; import javafx.stage.Stage;
/** /**
@ -30,6 +32,11 @@ public class ResultWindowController {
@Override @Override
public void update() { public void update() {
results.setText(valueHandler.getResultBound()); 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))));
}
} }
}); });
} }