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

Css style with icon for Label is not reset properly

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4 P4
    • tbd
    • fx2.0.2
    • javafx
    • linux x68, jdk1.7.0_07

      I have a Label and I switch styles with Label.getStyleClass().remove("oldStyle") & getStyleClass().add("newStyle").
      This works fine for the Label's text, the style changes as expected. (even if I just remove the old style and don't add a new one, the text is redisplayed with default color)
      But if my oldStyle contains a icon defined with -fx-graphic, and the newStyle doesn't, the icon is still displayed. It is not removed.

      Use the provided demo.
      Select style errorMessage, press button setStyle, then select style infoMessage, then press button setStyle
      Select style errorMessage, press button setStyle, then press button reset.

      note: not sure about the version. It is the one that comes with jdk1.7.0_07

            Unassigned Unassigned
            duke J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Imported: