You need a class which implements the java.awt.event.ActionListener class. This will receieve notifications about button clicks using the actionPerformed() method. You can use something like
Code:
JButton b = ...
...
public void actionPerformed(ActionEvent e) {
if (e.getSource() == b) {
// button clicked
}
}
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.