And how would i make it work form a different class file?
Import it, if you need to, and then create an instance of it.
how to use the action listeners that are attached to the buttons
Place the logic that you’d like to be executed within the actionPerformed(ActionEvent e)
method of the ActionListener
class (or subclass).
For more information, see How to Write an Action Listener.
4
solved Action Listeners [closed]