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.
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.