[External] : Re: Easier placement of stages with positioning anchor

Andy Goryachev andy.goryachev at oracle.com
Tue Nov 25 22:27:04 UTC 2025


I see, thanks for clarifying!

This seems interesting - perhaps it can be extended further to support the following scenarios:

- allow to specify the anchor in terms of exact pixels relative to the Stage origin (as opposed to fraction of its size)

- allow to specify the fallback policy for when the Stage cannot be positioned as requested (e.g. similar to a context menu popup).  For example, [no relocation, only vertically, only horizontally, in any direction]

What do you think?

-andy


From: Michael Strauß <michaelstrau2 at gmail.com>
Date: Tuesday, November 25, 2025 at 14:09
To: Andy Goryachev <andy.goryachev at oracle.com>
Cc: openjfx-dev <openjfx-dev at openjdk.org>
Subject: [External] : Re: Easier placement of stages with positioning anchor

> This is just about convenience, since all the desired positions can be pre-computed and the Stage can be positioned using existing public APIs, right?

Mostly yes, it's for convenience because there's quite a bit of math
going on which you're unlikely to replicate in a minute.

But there's a small no, it's not just about convenience: if you don't
set the size of the stage, then you won't know its actual size until
it is shown. But by the time it's shown, it is too late to adjust its
position (you might get a short flicker because the window is
repositioned right after it is shown).

The implementation here adjusts the position right before the window
is shown, that's something that user code can't do (look for
Window::fixBounds).
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/openjfx-dev/attachments/20251125/921d764c/attachment.htm>


More information about the openjfx-dev mailing list