D
dario.8282
i have a jlist; i put in a vector of string
Vector v_righe = new Vector();
JList list_righe = new JList(v_righe);
i select an element of the jlist with the mouse
i would like to deselect the element push a button...
i call
list_righe.clearSelection();
....that cause the exception:
Exception in thread "AWT-EventQueue-1"
java.lang.ArrayIndexOutOfBoundsException: -1
at java.util.Vector.get(Vector.java:696)
i have tried to do these controls...
if(v_righe.size()>0){
if(!list_righe.isSelectionEmpty())
list_righe.clearSelection();
}
but it's the same...
what's the problem?
thank's!
Vector v_righe = new Vector();
JList list_righe = new JList(v_righe);
i select an element of the jlist with the mouse
i would like to deselect the element push a button...
i call
list_righe.clearSelection();
....that cause the exception:
Exception in thread "AWT-EventQueue-1"
java.lang.ArrayIndexOutOfBoundsException: -1
at java.util.Vector.get(Vector.java:696)
i have tried to do these controls...
if(v_righe.size()>0){
if(!list_righe.isSelectionEmpty())
list_righe.clearSelection();
}
but it's the same...
what's the problem?
thank's!