In RHE book chapter 10, Test Yourself question9: True or false: A component subclass that has executed enableEvents() to enable processing of a certain kind of event cannot also use an adapter as a listener for the same kind of event. Ans: false. As my opinion,this question is trying to test a component can implements unlimited listeners.But my question is: the component in this question has extended a super component class, how can it extends another class like adapter class? Can anyone kindly give me a reply to explain that? Thanks a lot!
Joined: Jul 29, 2001
Kathy, You are taking it a bit wrongly..it simply means that this subclass can register itself with an object of other class that extends the adapter class. HIH. ashok.
Joined: Sep 29, 2000
You can use an anonymous inner class that uses the adapter and listens for the same type of events that the enableEvents is listening for.
"JavaRanch, where the deer and the Certified play" - David O'Meara
Joined: Sep 06, 2001
Thanks ashok and Cindy! Your explanations do make sense to me now. I took it too limited to a range, and I did not consider all possibilities. Thanks again.