Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8125642

setStyle(null) and setStyle("") does not undo a previous setStyle() call

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 8
    • 7u7
    • javafx
    • None
    • Windows XP, windows 7

      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()");
          }

       

            dgrieve David Grieve
            ethompsonjfx Edward Thompson (Inactive)
            Votes:
            3 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: