class Event{Event(){Button bt=new Button("变红");bt.addActionListener(new Test());//事件源bt}class Test implements ActionListener{ //实现了接口public void actionPerformed(ActionEvent e){....}//实现接口里的方法}就相当于bt要发令给newTest(),newTest()所在的类Test要长耳朵才可以接受到bt发的命令,所谓的Test类要长耳朵就是要实现接口ActionListener,如果长了,当bt按下的时候就自动调用了Test类里的方法,而方法内部的参数e就是用来接受bt所产生的一个对象!