日期:2014-05-20 浏览次数:20601 次
import java.awt.*; import java.awt.event.*; public class ActionEvent{ public static void main(String[] args){ Frame f = new Frame("xiaohua"); Button b = new Button(); Monitor m = new Monitor(); b.addActionListener(m); f.pack(); f.setVisible(true); } } class Monitor implements ActionListener{ void actionPerformed(ActionEvent e) { //actionPerformed(ActionEvent) System.out.println("cool boy"); } }
class Monitor implements ActionListener{ public void actionPerformed(java.awt.event.ActionEvent e) { System.out.println("cool boy"); } }