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. snapshot6.png
          16 kB
          Sergey Lugovoy
        2. snapshot5.png
          16 kB
          Sergey Lugovoy
        3. snapshot4.png
          16 kB
          Sergey Lugovoy
        4. snapshot3.png
          16 kB
          Sergey Lugovoy
        5. snapshot2.png
          16 kB
          Sergey Lugovoy

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

              Created:
              Updated:
              Imported: