看看哪有错?监听咋实现不了?
import javax.swing.*;import java.awt.*;
import java.awt.event.*;
public class aa {
public static void main(String[] arge){
JButton b=new JButton("zhang");
JFrame f=new JFrame("Test");
Mon bn=new Mon();
b.addActionListener(bn);
f.add(b,BorderLayout.CENTER);
f.pack();
f.setVisible(true);
}
class Mon implements Actionlistener{
public void actionPerformed(ActionEvent e){
System.out.println("li");
}
}
}
}
----------------解决方案--------------------------------------------------------
Actionlistener写错了ActionListener
----------------解决方案--------------------------------------------------------