how to catch event in an Inner Class?

Hi,

Class A has an inner class Button Listener which listens Action Events. I want to add this event listener to buttons inclass B. why i need to do it this way is because, i need to use many methods and variables ofclass A once the event is fired.

speaking in object oriented way....

I need to access the inner class of Class A from Class B.

*noteclass Bis initiated inclass A

I suppose there is a simple object oriented solution for this. plz Help.

regards,

Rajesh Rapaka.

[573 byte] By [R.Rajesha] at [2007-11-26 13:38:52]
# 1

This sounds like some strong coupling going on and is generally really bad OO.

Instead why isn't Class A a ButtonListener? If the button listener uses all these ClassA methods they should be one class or the logic should be separated better.

Also, you might want to look into using Actions. They make this kind of thing easier.

zadoka at 2007-7-7 22:32:26 > top of Java-index,Security,Event Handling...