I have a main gui that calls out a form for the user to fill out as a child class. I want the parent class(main gui) to know when the user clicks a button, so I was wondering if it's possible to create an event listener connected to the button from the parent class. I made the button public and could create the action event listener for the button in the parent class, but it still wouldn't recognize the button being clicked. Any help would be great, thanks.
posted 12 years ago
Your idea seems to work okay in the code below. You could also leave the listener in the same class as the component that it's registered on and have it call a method in the parent class to handle the notification of event occurrence.
Crusading Chameleon likes the size of this ad:
the new thread boost feature brings a LOT of attention to your favorite threads