• Post Reply Bookmark Topic Watch Topic
  • New Topic

Problem with ListSelectionListener  RSS feed

 
Dilip kumar
Ranch Hand
Posts: 360
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
What's wrong with this code ?
I'm getting error "undefined variable this".
public class client implements ListSelectionListener {
public static void main(String args[]) {
EmployeeTableModel model = new EmployeeTableModel();
JTable EmployeeTable = new JTable(model);

EmployeeTable.setShowGrid(true);
EmployeeTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);

/* Code to identify row selected in Jtable */
ListSelectionModel rowSM = EmployeeTable.getSelectionModel();
rowSM.addListSelectionListener(this);
 
srilatha malip
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dilip,
U are not supposed to use "this" in the main method. That's what I got after looking at ur code.
Srilatha.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!