But I m adding the listener on selection model only. Can you tell me how to
stop even if some wiered is happening? Or at least how to find whats wrong
in there?

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, September 11, 2002 4:22 PM
To: Bhangale, Bhushan
Cc: 'Advanced-Swing'
Subject: Re: ListSelectionListener in JTable


Are you maybe being notified of a row selection change and a column
selection 
change?

Evan

junquemale -at- yahoo.com

Bhangale, Bhushan wrote:
> I have added listener like this :-
>  
> TableSelectionListener tableSelectionListener = new
> TableSelectionListener();
>
table.getSelectionModel().addListSelectionListener(tableSelectionListener);
>  
>  
> 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.
>  


"The information in this e-mail, and any attachment therein, is 
confidential and for use by the addressee only. If you are not the 
intended recipient, please return the e-mail to the sender and delete 
it from your computer. Although The Bank of New York attempts to 
sweep e-mail and attachments for viruses, it does not guarantee that 
either are virus-free and accepts no liability for any damage sustained 
as a result of viruses." 

_______________________________________________
Advanced-swing mailing list
[EMAIL PROTECTED]
http://eos.dk/mailman/listinfo/advanced-swing

Reply via email to