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

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

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


            Unassigned Unassigned
            cdea Carl Dea
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Imported: