Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Error at addListSelectionListener(this)

 
deepak carter
Ranch Hand
Posts: 165
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

its showing an in the line // list.addListSelectionListener(this);

 
Rob Spoor
Sheriff
Pie
Posts: 20527
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Next time please show the error. However, this time it's pretty obvious - this is an instance of JListTest, and that does not implement ListSelectionListener.
 
Randall Twede
Ranch Hand
Posts: 4390
3
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
it was even obvious to me. you have to implement the listener interface
 
Darryl Burke
Bartender
Posts: 5126
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Or better still, add a ListSelectionListener in the form of an anonymous inner class.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic