java sing actionn istener code example
Example: actionListener java
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
/*in main*/
button.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
System.out.println('x');
}
});