• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Frank Carver
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • fred rosenberger

Problem with ListSelectionListener

 
Ranch Hand
Posts: 360
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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);
 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
No one can make you feel inferior without your consent - Eleanor Roosevelt. tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic