This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes create customised listener Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "create customised listener" Watch "create customised listener" New topic

create customised listener

sanjey asok
Ranch Hand

Joined: Jul 11, 2009
Posts: 39
I want to create a customized listener in Java, I explain as follow

I have a class A which has a property "name" as String type ,when the value of "name" is changed some method should be called.

So I want a listener to listen and catch the value change,How It can be done?
Geoff Jefferson
Ranch Hand

Joined: Apr 09, 2009
Posts: 102
Can you post your class so we can see?

Rob Spoor

Joined: Oct 27, 2005
Posts: 20132

Seems like a PropertyChangeListener would do. You can even use PropertyChangeSupport to do all the hard work for you.

How To Ask Questions How To Answer Questions
I agree. Here's the link:
subject: create customised listener
It's not a secret anymore!