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

CheckBox render inconsistency with style -fx-alignment:baseline-*

XMLWordPrintable

      Code to reproduce :

      @Override
          public void start(Stage stage) throws Exception {
              BorderPane root = new BorderPane();
              final CheckBox checkbox = CheckBoxBuilder.create().text("Check box the first line" +
                      "\nthe sec long line" + "\nthe third line")
                          .graphic(new Rectangle(20, 20, Color.web("lightblue")))
                              .focusTraversable(false).build();
              Scene scene = new Scene(root, 500, 500);
              checkbox.setMinSize(500, 150);
              ChoiceBox choiceBox = new ChoiceBox();
              choiceBox.getItems().addAll(Pos.values());
              choiceBox.valueProperty().addListener(new ChangeListener() {
                  @Override
                  public void changed(ObservableValue observableValue, Object o, Object o2) {
                      checkbox.setStyle("-fx-border-color:green;-fx-alignment:" + o2 + ";");
                  }
              });
              root.setTop(choiceBox);
              root.setCenter(checkbox);
              stage.setScene(scene);
              stage.show();
              stage.setTitle(VersionInfo.getRuntimeVersion());
          }

        1. snapshot2.png
          snapshot2.png
          16 kB
        2. snapshot3.png
          snapshot3.png
          16 kB
        3. snapshot4.png
          snapshot4.png
          16 kB
        4. snapshot5.png
          snapshot5.png
          16 kB
        5. snapshot6.png
          snapshot6.png
          16 kB

            Unassigned Unassigned
            slugovoy Sergey Lugovoy (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Imported: