Fix listboxes bug (could not see bottom item) 61/11061/1
Vincent COUVERT [Wed, 27 Mar 2013 15:39:17 +0000 (16:39 +0100)]
Change-Id: Id9e5bd6510e04a6e21446fd6094d243a0612f69f

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

index 46f777d..138b5b7 100644 (file)
@@ -473,7 +473,7 @@ public class SwingScilabListBox extends JScrollPane implements SwingViewObject,
      */
     public void setListBoxTop(int index) {
         getVerticalScrollBar().removeAdjustmentListener(adjustmentListener);
-        if (index > 0) {
+        if (index > 0 & index != getListBoxTop()) {
             getViewport().setViewPosition(getList().getUI().indexToLocation(getList(), index - 1));
             doLayout();
         }