RFR: 8370446: Support dialogs with StageStyle.EXTENDED (Preview) [v5]
Kevin Rushforth
kcr at openjdk.org
Tue Nov 18 16:12:34 UTC 2025
On Sat, 15 Nov 2025 02:18:49 GMT, Michael Strauß <mstrauss at openjdk.org> wrote:
>> Adds the `DialogPane.headerBar` property, which allows developers to specify a custom `HeaderBar` when the dialog uses the `EXTENDED` stage style.
>
> Michael Strauß has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains nine commits:
>
> - Merge branch 'master' into feature/extended-dialog
>
> # Conflicts:
> # modules/javafx.controls/src/test/java/test/javafx/scene/control/DialogPaneTest.java
> - fix incorrect button metrics
> - documentation
> - Merge branch 'master' into feature/extended-dialog
> - move HeaderBar to DialogPane
> - document/verify preview feature
> - Ensure that DialogPane is always attached to Scene
> - Lazily initialize Dialog.headerBar
> - Support dialogs with StageStyle.EXTENDED
Running a simple Dialog test that doesn't try to use `HeaderBar` or `StageStyle.EXTENDED` gets a RuntimeException _without_ enabling preview features.
To reproduce, run HelloAlert from apps/toys/Hello or use the MonkeyTester without setting `javafx.enablePreview` and bring up an alert dialog:
Exception in thread "JavaFX Application Thread" java.lang.RuntimeException: HeaderBar is a preview feature of JavaFX 26-internal.
Preview features may be removed in a future release, or upgraded to permanent features of JavaFX.
Programs can only use preview features when the following system property is set: -Djavafx.enablePreview=true
at javafx.base at 26-internal/com.sun.javafx.PreviewFeature.checkEnabled(PreviewFeature.java:71)
at javafx.controls at 26-internal/javafx.scene.control.DialogPane.getHeaderBar(DialogPane.java:487)
at javafx.controls at 26-internal/javafx.scene.control.DialogPane.computePrefWidth(DialogPane.java:1077)
...
-------------
Changes requested by kcr (Lead).
PR Review: https://git.openjdk.org/jfx/pull/1943#pullrequestreview-3478607121
More information about the openjfx-dev
mailing list