permaculture playing cards*
The moose likes Java in General and the fly likes need help with adding listener Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "need help with adding listener" Watch "need help with adding listener" New topic
Author

need help with adding listener

Candy Bortniker
Ranch Hand

Joined: Mar 17, 2003
Posts: 123
I am trying to add a propertyChangeListener. I got some help from the "How to" section of the API but the statement textfield.addPropertyChangeListener(this) is giving me a compile error and I don't know what need to be fixed.
Wayne L Johnson
Ranch Hand

Joined: Sep 03, 2003
Posts: 399
Try:

In order to do "textfield.addPropertyChangeListener(this);" the object you are registering ("this") must be a PropertyChangeListener. Since you've already implemented the public void propertyChange(PropertyChangeEvent evt) method you just have to make sure that your class (BlueSliderBeanFrame) is a PropertyChangeListener.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: need help with adding listener