changeset 7709:916da7f77a61

RT-38347: [Dialogs] HelloAlert ESC and (x) do not close dialog that only has 'OK'
author jgiles
date Tue, 19 Aug 2014 10:32:58 +1200
parents ffedbb480817
children 348f681e0717
files modules/controls/src/main/java/javafx/scene/control/HeavyweightDialog.java
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/modules/controls/src/main/java/javafx/scene/control/HeavyweightDialog.java	Mon Aug 18 15:31:54 2014 -0700
+++ b/modules/controls/src/main/java/javafx/scene/control/HeavyweightDialog.java	Tue Aug 19 10:32:58 2014 +1200
@@ -138,7 +138,9 @@
             if (dialogPane != null) {
 
                 List<ButtonType> buttons = dialogPane.getButtonTypes();
-                if (buttons.size() != 1) {
+                if (buttons.size() == 1) {
+                    denyClose = false;
+                } else {
                     // look for cancel button type
                     for (ButtonType button : buttons) {
                         if (button == null) continue;