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

CSS: background-image not visible

    XMLWordPrintable

Details

    Description

      -fx-background-image seems to be always painted over with content.

      I tried to reduce everything to a minimum, so i gave it a extra css-style with image-attributs only.

      /*controlStyle.css*/
      .button2
      {
      -fx-background-image: url("BtnDBg.gif");
      -fx-background-image-repeat:repeat-x;
      -fx-background-image-size: auto;
      }

      And gave my button this style only.
      scene.getStylesheets().addAll("/test/controlStyle.css");
      b.getStyleClass().remove(0); //remove button styleclass
      b.getStyleClass().add("button2"); //add button2 styleclass

      It still is painted like a normal button. (see screenshot)

      Is there a way to set -fx-background-color or -fx-color to opaque, so the background-image is visible? do i have a completly wrong approach or is there anything wrong with the painting order?

      Kind Regards,
      Matthias Weidemann

      Attachments

        Activity

          People

            dgrieve David Grieve
            mweidemanjfx Matthias Weidemann (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              Imported: