The EventObject which is the super class of the ListSelectionEvent has a getSource() method which would tell you which table is the source of the event being handled. Only issue is u have to compare this source object with ur table references. If thats fine then this should help u.
public Object getSource() The object on which the Event initially occurred. --Shankar -----Original Message----- From: abhay [mailto:[EMAIL PROTECTED]] Sent: Wednesday, December 04, 2002 2:53 PM To: JDJList Subject: [jdjlist] JTable problem Hi all, I have a 2 JTables on a panel say tbl1 and tbl2. I have added a ListSelectionListener to both of them ... in this fashion. ... ... tbl1.getSelectionModel().addListSelectionListener(this); tbl2.getSelectionModel().addListSelectionListener(this); ... ... and I'm capturing the event in the valueChanged(ListSelectionEvent lse) { } method. How will I know which table fired the event ?? I don't want to implement the listener as an anonymous inner class. Please help me. Thanks in advance. regards Abhay ____________________________________________________ To change your JDJList options, please visit: http://www.sys-con.com/java/list.cfm Be respectful! Clean up your posts before replying ____________________________________________________ ____________________________________________________ To change your JDJList options, please visit: http://www.sys-con.com/java/list.cfm Be respectful! Clean up your posts before replying ____________________________________________________
