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

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 8, 9
    • Fix Version/s: 9
    • Component/s: javafx
    • Environment:

      Ubuntu 12.04 64 bit, java version "1.8.0_25"
      Java(TM) SE Runtime Environment (build 1.8.0_25-b17)

      Description

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

      }

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported: