public ListSelectionEvent(Object source,
int firstIndex,
int lastIndex,
boolean isAdjusting)
Represents a change in selection status between firstIndex and lastIndex inclusive (firstIndex is less than or equal to lastIndex). At least one of the rows within the range will have changed, a good ListSelectionModel implementation will keep the range as small as possible.
Parameters:firstIndex - the first index that changed
lastIndex - the last index that changed, lastIndex >= firstIndex
isAdjusting - an indication that this is one of rapid a series of events
int firstIndex,
int lastIndex,
boolean isAdjusting)
Represents a change in selection status between firstIndex and lastIndex inclusive (firstIndex is less than or equal to lastIndex). At least one of the rows within the range will have changed, a good ListSelectionModel implementation will keep the range as small as possible.
Parameters:firstIndex - the first index that changed
lastIndex - the last index that changed, lastIndex >= firstIndex
isAdjusting - an indication that this is one of rapid a series of events
所以程序员一般在处理多项选择时都要加上:
if(event.getValueIsAdjusting())
//do something