Bhangale, Bhushan wrote:
>So how to get rid of it?
>
>-----Original Message-----
>From: ak [mailto:[EMAIL PROTECTED]]
>Sent: Thursday, September 12, 2002 6:53 AM
>To: [EMAIL PROTECTED]
>
>
>Subject: RE: ListSelectionListener in JTable
>
>>My listener class :-
>>
>>class TableSelectionListener implements ListSelectionListener {
>> public void valueChanged(ListSelectionEvent event) {
>> if (event.getSource() == table.getSelectionModel() &&
>>table.getRowSelectionAllowed()) {
>> int first = event.getFirstIndex();
>> int last = event.getLastIndex();
>> LogManager.log.debug("Row selection changed = " + first + " " + last);
>> }
>> }
>> }
>>
>>The problem is when I click select a row it calls the listener twice.
>>
>>
>
>may be it called first time for deselecting the last selected row and second
>time for selecting the new row
>
>Regards
>
>Andrei
>
If your classe implements the ListSelectionListener
public void valueChanged(ListSelectionEvent event) {
lsm.removeListSelectionListener(this);
//Your code here.............
lsm.addListSelectionListener(this);
}
_______________________________________________
Advanced-swing mailing list
[EMAIL PROTECTED]
http://eos.dk/mailman/listinfo/advanced-swing