changeset 8190:a151b45a99fe

RT-38516: [DialogPane] ContentText sometimes not displayed
author jgiles
date Mon, 13 Oct 2014 14:15:46 -0700
parents 6c32224edbf9
children 798a3a796c26
files modules/controls/src/main/java/javafx/scene/control/DialogPane.java
diffstat 1 files changed, 6 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/modules/controls/src/main/java/javafx/scene/control/DialogPane.java	Mon Oct 20 14:07:53 2014 -0400
+++ b/modules/controls/src/main/java/javafx/scene/control/DialogPane.java	Mon Oct 13 14:15:46 2014 -0700
@@ -528,10 +528,8 @@
             }
             
             Node newContent = getContent();
-            contentRef = new WeakReference<Node>(newContent);
-            if (newContent != null) {
-                updateContentArea();
-            }
+            contentRef = new WeakReference<>(newContent);
+            updateContentArea();
         }
     };
 
@@ -1041,11 +1039,10 @@
             contentLabel.setManaged(false);
         } else {
             final String contentText = getContentText();
-            if (contentText != null && !contentText.isEmpty()) {
-                contentLabel.setText(contentText);
-                contentLabel.setVisible(true);
-                contentLabel.setManaged(true);
-            }
+            final boolean visible = contentText != null && !contentText.isEmpty();
+            contentLabel.setText(visible ? contentText : "");
+            contentLabel.setVisible(visible);
+            contentLabel.setManaged(visible);
         }
     }