> This looks interesting.
>
> Can this be used to center a new stage on another stage?

You'd have to do a bit of math to figure out the center of the primary
stage, but sure:

    double x = primaryStage.getX() + primaryStage.getWidth() / 2;
    double y = primaryStage.getY() + primaryStage.getHeight() / 2;
    popupStage.show(x, y, Stage.Anchor.ofRelative(0.5, 0.5));

What makes this feature different from simply calculating the X/Y
coordinate of the new stage manually is that with show(x, y, anchor)
the new stage will be automatically repositioned so that it is
completely on-screen, which is important for usability.

Reply via email to