initialize field in SwingScilabListItem.java 22/14022/2
Antoine ELIAS [Fri, 14 Mar 2014 11:44:16 +0000 (12:44 +0100)]
Change-Id: Id51f65dc4a251ff9416c0027dacb1508f96dbbc8

scilab/modules/gui/src/java/org/scilab/modules/gui/bridge/listbox/SwingScilabListBox.java
scilab/modules/gui/src/java/org/scilab/modules/gui/utils/SwingScilabListItem.java

index f676960..2f94b9b 100644 (file)
@@ -111,6 +111,9 @@ public class SwingScilabListBox extends JScrollPane implements SwingViewObject,
                     if (isSelected == false && item.getForeground() != null) {
                         label.setForeground(item.getForeground());
                     }
+                } else {
+                    label.setText("");
+                    label.setIcon(null);
                 }
                 return label;
             }
index 4ebd7c9..26290a7 100644 (file)
@@ -5,10 +5,10 @@ import java.awt.Color;
 import javax.swing.Icon;
 
 public class SwingScilabListItem {
-    private String text;
-    private Icon icon;
-    private Color background;
-    private Color foreground;
+    private String text = null;
+    private Icon icon = null;
+    private Color background = null;
+    private Color foreground = null;
 
     /**
      * Constructor