wood burning stoves*
The moose likes Swing / AWT / SWT and the fly likes ChangeListener cannot be resolved to a type Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "ChangeListener cannot be resolved to a type" Watch "ChangeListener cannot be resolved to a type" New topic
Author

ChangeListener cannot be resolved to a type

Hugh Roarty
Greenhorn

Joined: Nov 28, 2006
Posts: 15
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

Joined: May 03, 2008
Posts: 4531
    
    5

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.)


luck, db
There are no new questions, but there may be new answers.
Hugh Roarty
Greenhorn

Joined: Nov 28, 2006
Posts: 15
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
 
subject: ChangeListener cannot be resolved to a type