I\'m creating a gui application that requires some simple input, however, when I click the button in the JFrame the actionPerformed method I\'m using is not fired/firing (no
You must add an "addActionListener to your button
You need to add an action listener to your button component like this.
closeButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
closeButtonActionPerformed(evt);
}
});
private void closeButtonActionPerformed(java.awt.event.ActionEvent evt) {
dispose();
}
You could also use @182Much's method as was discussed here: java detect clicked buttons Hope it is helpful if there are still concerns.