Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ChangeListener cannot be resolved to a type

 
Hugh Roarty
Greenhorn
Posts: 15
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's been a while since I've grappled with Java so I'm a bit rusty. I've got a feeling there may be a simple explanation to my problem...

My 'TestPanel' class extends JPanel. In the constructor for 'TestPanel' I have added a JSlider object called 'slider' to my panel. I now wish to write a private class called 'SliderListener' that implements ChangeListener then I can add a listener to my slider.

Unfortunately my IDE tells me that ChangeListener cannot be resolved to a type. Have I imported the correct packages or is there some other reason ChangeListener is not recognised?

Here is my code...


 
Darryl Burke
Bartender
Posts: 5115
11
Java Netbeans IDE Opera
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hugh Roarty wrote:Unfortunately my IDE tells me that ChangeListener cannot be resolved to a type. Have I imported the correct packages or is there some other reason ChangeListener is not recognised?

Have you looked up the API for ChangeListener? You'll find the package mentioned there. (Hint: no, you haven't imported it.)
 
Hugh Roarty
Greenhorn
Posts: 15
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Darryl,

Its so long since I've wrote code that I forgot how useful the API is...

import javax.swing.event.*;
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic