I have two containers in two classes and I'm adding them to a JFrame. Can I have a button in one container that I can add a ActionListener for that the action is in the other container?
Well sweet :)
I assume its this line of code that needs changing:
What do I replace "this" with to point to a actionPerformed method in another class?
An instance of that class assuming that it implements the ActionListener interface.
Your use of this web site or any of its content or software indicates your agreement to be bound by these Terms of Participation.
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.