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

Left padding of CheckBox doesn't only add padding to the left, but also to top

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 9
    • 8, 9
    • javafx
    • Ubuntu 12.04 64 bit, java version "1.8.0_25"
      Java(TM) SE Runtime Environment (build 1.8.0_25-b17)

      The example should show that the CheckBox (check) is not aligned with the ComboBox. It should be at the same vertical location and the left distance should be 80px. Instead it has 80px to left _and_ the top.

      import javafx.application.Application;
      import javafx.geometry.Insets;
      import javafx.geometry.Pos;
      import javafx.scene.Scene;
      import javafx.scene.control.CheckBox;
      import javafx.scene.control.ComboBox;
      import javafx.scene.layout.HBox;
      import javafx.stage.Stage;

      public class Test extends Application {

      @Override
      public void start(Stage primaryStage) {
      ComboBox box = new ComboBox();
      CheckBox check = new CheckBox();
      check.setPadding(new Insets(0,0,0,80));

      HBox root = new HBox(box, check);
      root.setAlignment(Pos.BASELINE_LEFT);

      Scene scene = new Scene(root, 400, 250);

      primaryStage.setScene(scene);
      primaryStage.show();
      }

      public static void main(String[] args) {
      launch(args);
      }

      }

            aghaisas Ajit Ghaisas
            toelgartejfx Tobias Oelgarte (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: