File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java in General and the fly likes java bean listens to itself? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "java bean listens to itself?" Watch "java bean listens to itself?" New topic

java bean listens to itself?

Bret Waldow
Ranch Hand

Joined: Aug 04, 2000
Posts: 59
I'm working my way through Stanchfield and Mauny's "Effective VisualAge for Java" and I noticed in the chapters where I'm creating beans with bound properties, the bean fires change notification to any other object that's registered itself as interested in the change.
The also provide two examples of adding (after the fact, of course) a bound property (the text in each case) to Swing JTextField and AWT TextField. In each of these cases, they also include modifications in the constructors so each bean notifies itself.
Why? I see no discussion in the book to tell me the difference, so I'll understand where and where not to apply this myself in the future. I'm SCJ2P, and I don't remember learning anything about this.
Thanks in advance,
Cindy Glass
"The Hood"

Joined: Sep 29, 2000
Posts: 8521
I would have to believe that the beans were also listeners that reacted to some change in the textfield.

"JavaRanch, where the deer and the Certified play" - David O'Meara
I agree. Here's the link:
subject: java bean listens to itself?
It's not a secret anymore!