import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
public class MainClass {
public static void main(String[] argv) {
JButton theButton = new JButton();
new ActionListener() {
public void actionPerformed(ActionEvent e) {
System.out.println("The action has occurred");
}
};
}
}
|