IntelliJ Java IDE
The moose likes Swing / AWT / SWT / JFace and the fly likes Error at addListSelectionListener(this) Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT / JFace
Reply Bookmark "Error at addListSelectionListener(this)" Watch "Error at addListSelectionListener(this)" New topic
Author

Error at addListSelectionListener(this)

deepak carter
Ranch Hand

Joined: Feb 19, 2011
Posts: 136
Hi All,

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

Rob Spoor
Saloon Keeper

Joined: Oct 27, 2005
Posts: 18376

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.


SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions How To Answer Questions
Randall Twede
Ranch Hand

Joined: Oct 21, 2000
Posts: 3905
it was even obvious to me. you have to implement the listener interface


I never took notes in college. That's how I got a 4.0 the first 2 years, and a 3.5 the second two years.
Darryl Burke
Bartender

Joined: May 03, 2008
Posts: 3221

Or better still, add a ListSelectionListener in the form of an anonymous inner class.


luck, db
There are no new questions, but there may be new answers.
 
IntelliJ Java IDE
 
subject: Error at addListSelectionListener(this)
 
Threads others viewed
JToolTip displays JList selected text, later
JList selection questions
GridBagLayout resize issue
Address already in use:JVM_Bind
How can I show System Information On GUI using AWT/Swing
developer file tools