java action listener for button code example
Example 1: how to create an action listener in java
button.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent actionEvent)
{
}
});
Example 2: action listener of jbutton
jBtnSelection.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
selectionButtonPressed();
}
} );