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

Button with Text and Graphic has incorrect alignment of Graphic

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: P4 P4
    • 8
    • 8
    • javafx
    • Windows 7 64-bit
      Java Version: 1.8.0-ea-b108
      JavaFX Version: 8.0.0-ea-b108

      In b108 graphics in buttons are not aligned correctly.

      ToggleButton button = new ToggleButton();
      button.textProperty().bind(someTextProperty);
      button.setGraphic(myImage);
      button.setAlignment(Pos.TOP_CENTER);
      button.setContentDisplay(ContentDisplay.BOTTOM);
      button.setTextAlignment(TextAlignment.CENTER);
      button.setTextOverrun(OverrunStyle.ELLIPSIS);

      With Java 8 b108, the left edge of the graphic is in the center of the button.
      With Java 8 b106, the center of the graphic is in the center of the button.
      The text is correctly centered in the button above the graphic in both cases.

            leifs Leif Samuelsson (Inactive)
            swpalmer Scott Palmer
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: