addListSelectionListener
public void addListSelectionListener(ListSelectionListener listener)
Adds a listener to the list that's notified each time a change to the selection occurs. Listeners added directly to the JList will have their ListSelectionEvent.getSource() == this JList (instead of the ListSelectionModel).
Parameters:
listener - the ListSelectionListener to add