In the latest production version, in the following code,
srcTitle.setStyle("-fx-border-color: red;"); results in a red border around the textfield srcTitle, but a subsequent call setStyle(null) or setStyle("") does NOT set it back to the default.
It stays red.
public void handleSrcSave() throws IOException {
log.debug("Entering handleSrcSave()");
srcTitle.setStyle("");
if (getCurrentSource().getTitle() == null
|| getCurrentSource().getTitle().isEmpty()) {
srcTitle.setStyle("-fx-border-color: red;");
MessageController.showMessage(srcTitle.getScene().getWindow(), MessageController.ERROR, "A Source Title is required.");
} else if (getCurrentSource().getTitle().length() > 40) {
srcTitle.setStyle("-fx-border-color: red;");
MessageController.showMessage(srcTitle.getScene().getWindow(), MessageController.ERROR, "A Source Title is limited to 40 characters.");
} else {
new Thread(new SourceDbTask(srcTitle.getScene().getWindow(), mySource, "U")).start();
}
log.debug("Exiting handleSrcSave()");
}
srcTitle.setStyle("-fx-border-color: red;"); results in a red border around the textfield srcTitle, but a subsequent call setStyle(null) or setStyle("") does NOT set it back to the default.
It stays red.
public void handleSrcSave() throws IOException {
log.debug("Entering handleSrcSave()");
srcTitle.setStyle("");
if (getCurrentSource().getTitle() == null
|| getCurrentSource().getTitle().isEmpty()) {
srcTitle.setStyle("-fx-border-color: red;");
MessageController.showMessage(srcTitle.getScene().getWindow(), MessageController.ERROR, "A Source Title is required.");
} else if (getCurrentSource().getTitle().length() > 40) {
srcTitle.setStyle("-fx-border-color: red;");
MessageController.showMessage(srcTitle.getScene().getWindow(), MessageController.ERROR, "A Source Title is limited to 40 characters.");
} else {
new Thread(new SourceDbTask(srcTitle.getScene().getWindow(), mySource, "U")).start();
}
log.debug("Exiting handleSrcSave()");
}