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

GridPane inside StackPane placed in the wrong position

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P4 P4
    • fx2.0
    • fx2.0
    • javafx
    • None
    • Mac OS X, JavaFX 2.0 Beta EA, javafx_sdk-2_0-ea-b18-macosx-universal.zip

      The following code does not place the label in the correct place with respect to the rectangle:

      final Label label = new Label("LABEL");
      GridPane g = new GridPane();
      GridPane.setConstraints(label, 0, 0);
      g.getChildren().add(label);

      Rectangle r = new Rectangle(100, 100, Color.BLUE);

      final StackPane stack = new StackPane();
      stack.getChildren().addAll(r, g);

      stage.setScene(new Scene(stack, 200, 500));
      stage.setVisible(true);

      If you take out the GridPane, and just use a Label directly it does work.

      I haven't verified if it is a Mac only problem, or also shows on Windows.

            amfowler Anne Fowler (Inactive)
            gmatthewsjfx Graham Matthews (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: