RFR: 8370446: Support dialogs with StageStyle.EXTENDED

Cormac Redmond duke at openjdk.org
Fri Oct 24 01:45:22 UTC 2025


On Tue, 21 Oct 2025 23:54:55 GMT, Michael Strauß <mstrauss at openjdk.org> wrote:

> Adds the `Dialog.headerBar` property, which allows developers to specify a custom `HeaderBar` when the dialog uses the `EXTENDED` stage style. The property is ignored for all other stage styles.

Hi. Another bug, a slightly more serious one this time.

Dialogs cannot be re-used. E.g., sequentially calling showAndWait() twice on the same instance, does not work:

![bug](https://github.com/user-attachments/assets/3c3c1614-f0ea-4469-9610-455d4b5e352a)

This works fine on older JFXs:

![nobug](https://github.com/user-attachments/assets/14275cfd-7e81-4332-941a-c264a3a21ab3)

Steps to reproduce:


public class DialogBugDemoThree extends Application {

    public static void main(String[] args) {
        launch(args);
    }

    @Override
    public void start(Stage primaryStage) {
        final Dialog<String> dialog = new Dialog<>();
        dialog.getDialogPane().setContent(new Label("Label"));
        ButtonType okButton = new ButtonType("OK", ButtonBar.ButtonData.OK_DONE);
        dialog.getDialogPane().getButtonTypes().addAll(okButton, ButtonType.CANCEL);

        // Show once
        dialog.showAndWait();

        // Show twice
        // This will NOT work (it shows a tiny window frame with no content)
        dialog.showAndWait();
    }
}

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

PR Comment: https://git.openjdk.org/jfx/pull/1943#issuecomment-3440326580


More information about the openjfx-dev mailing list