label : force refresh on text change 36/14336/4
Antoine ELIAS [Fri, 4 Apr 2014 09:40:56 +0000 (11:40 +0200)]
Change-Id: Id7459f9f6b5bdb4c8dd084b5882d5775b62db46e

scilab/modules/gui/src/java/org/scilab/modules/gui/bridge/label/SwingScilabLabel.java

index 9ff3618..d3d0afe 100644 (file)
@@ -396,14 +396,18 @@ public class SwingScilabLabel extends JScrollPane implements SwingViewObject, Si
             }
         }
 
-        ((JLabel) label).invalidate();
+        if (getParent() != null) {
+            getParent().invalidate();
+        }
         changeLabelType(LabelStyle.TEXT);
         ((JLabel) label).setText(labelText);
-        ((JLabel) label).validate();
+        if (getParent() != null) {
+            getParent().validate();
+        }
     }
 
     public void setEmptyText() {
-        setText(" ");
+        setText(null);
     }
 
     /**