Hi, I have noticed inconsistent and confusing size/layout behaviour with Dialogs when changing min width or height (after shown).
The behaviour depends on whether changing min width/height on the Stage, or the DialogPane itself, and whether show() or showAndWait() is used. In summary: 1. Set Stage mins + show() - no bug 2. Set Stage mins + showAndWait() - improper layout: background applies only to label (i.e., size before re-size), button wrong position, re-sizing window fixes the problem 3. 3 Set DialogPane mins + show() - min sizes are ignored, button is visible, until it comes into focus, and then the button disappears, you can find it if you resize window close to the mins set 4. 4 Set DialogPane mins + showAndWait() - no bug It's happening in JFX23/24/25. Note, these may seem trivial/fixable, or you may ask "why would you do that?", but there are reasons I won't clutter the mail with. Anyway, it's best presented with a set of examples and code. Re points 1 and 2 above, exact same code, except red is showAndWait() and green is show(): [image: image.png] Obviously, they should behave the same. Then slightly resize the red one: [image: image.png] Examples 3 and 4 above -- again, same code. Purple is show(), yellow is showAndWait(). [image: image.png] After you close the yellow dialog: [image: image.png] They should be the same size from the outset. public class DialogBug extends Dialog<Boolean> { public DialogBug(final String s, boolean flip) { setTitle("Bug"); setResizable(true); final DialogPane dp = getDialogPane(); dp.setStyle(s); dp.getButtonTypes().add(ButtonType.CLOSE); dp.setContent(new Label("Content")); // Setting stage size causes the bug setOnShown(e -> { if (flip) { // Set stage sizes Stage st = (Stage) dp.getScene().getWindow(); st.setMinHeight(260); st.setMinWidth(360); } else { // Set dialog sizes: note buttons disappear when you resize dp.setMinHeight(260); dp.setMinWidth(360); } }); } public static class BugApp extends Application { @Override public void start(final Stage st) throws Exception { final boolean FLIP_ME = true; // make true for other bug if (FLIP_ME) { // Note: bug doesn't happen when using show() only. Stage is fully green on show. new DialogBug("-fx-background-color: green;", true).show(); // NO BUG // showAndWait presents the bug; background not fully drawn, button shifts on re-size new DialogBug("-fx-background-color: red;", true).showAndWait(); // BUG } else { // A different type of issue: two different sizes and button behaviour // Notice: // - same dialogs, different sizes // - how button in purple dialog shifts when yellow dialog pane is closed new DialogBug("-fx-background-color: purple;", false).show(); // BUG new DialogBug("-fx-background-color: yellow;", false).showAndWait(); // NO BUG } } } } Thoughts? Kind Regards, Cormac