avoid multi selectionChange on ListBox 02/13902/3
Antoine ELIAS [Tue, 4 Mar 2014 17:32:43 +0000 (18:32 +0100)]
Change-Id: I82ae85ce62989db5fa8b29d9be459d1703f9b2cb

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

index 0cd39f3..63c9bfe 100644 (file)
@@ -111,6 +111,12 @@ public class SwingScilabListBox extends JScrollPane implements SwingViewObject,
 
         listListener = new ListSelectionListener() {
             public void valueChanged(ListSelectionEvent e) {
+
+                //value not ready
+                if (e.getValueIsAdjusting()) {
+                    return;
+                }
+
                 // Scilab indices in Value begin at 1 and Java indices begin at 0
                 int[] javaIndices = getList().getSelectedIndices().clone();
                 Double[] scilabIndices = new Double[javaIndices.length];