RFR: 8371859: Dialog unnecessarily invokes DialogPane.requestLayout()

Marius Hanl mhanl at openjdk.org
Fri Nov 14 08:03:37 UTC 2025


On Thu, 13 Nov 2025 21:24:25 GMT, Michael Strauß <mstrauss at openjdk.org> wrote:

> The implementation of `Dialog.dialogPane` adds a `ListChangeListener` to `DialogPane.getButtonTypes()`, and calls `DialogPane.requestLayout()` from the listener.
> 
> This is not needed, because the `DialogPane.createButtonBar()` method already specifies that implementers are required to observe changes of `DialogPane.getButtonTypes()`, and relayout the button bar as needed.
> 
> I've added a test to verify that changing the button types indeed requests a layout on the `DialogPane`.

Looks good. This is indeed a weird listener.
I checked the `ButtonBarSkin` and the implementation there looks good, so I do not see why this is ever needed. Good to remove it.

-------------

Marked as reviewed by mhanl (Committer).

PR Review: https://git.openjdk.org/jfx/pull/1973#pullrequestreview-3463444370


More information about the openjfx-dev mailing list