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

The ability to CSS style a JavaFX Button using the -fx-graphic to accept an SVG path.

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Unresolved
    • P4
    • tbd
    • 8u40
    • javafx
    • Windows 7, MacOSX, Linux

    Description

      Typically when styling JavaFX Button controls a user of the API can use the CSS -fx-graphic attribute to point to a url of an image file. However, it would be nice if the same attribute could use SVG paths.

      For example, you could create a plus sign like so:
       
      -fx-graphic: "M0,-1 V1 M-1,0 H1";


      NOTE: Currently in JavaFX this can be acheived like the following:
          StackPane buttonGraphic = new StackPane();
          buttonGraphic.getStyleClass().add("plus");
          Button button = new Button("blah");
          button.setGraphic(buttonGraphic);

          /* A button with a plus sign */
          .button .plus { -fx-shape: "M0,-1 V1 M-1,0 H1"; }


      Attachments

        Activity

          People

            Unassigned Unassigned
            cdea Carl Dea
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Imported: