importjava.awt.*;importjavax.swing.*;importjava.awt.event.*;publicclassAsdfJFrameextendsJFrameimplementsActionListener,ItemListener{publicAsdfJFrame(){..............省略的...
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
public class AsdfJFrame extends JFrame implements ActionListener,ItemListener{
public AsdfJFrame()
{
..............省略的程序
this.setVisible(true);
}
private void addmyMenu()//添加菜单栏的方法
{
...........................省略的程序
}
public void actionPerformed(ActionEvent e)
{
...........................省略的程序
}
public static void main(String arg[])
{
new AsdfJFrame();
}
}
各位高手看看!我想给按钮添加单击事件接口!
public class AsdfJFrame extends JFrame implements ActionListener,ItemListener{
但是编译器报错 :AsdfJFrame.java:4: AsdfJFrame 不是抽象的,并且未覆盖 java.awt.event.ActionListener 中的抽象方法 actionPerformed(java.awt.event.ActionEvent)
public class AsdfJFrame extends JFrame implements ActionListener,ItemListener{
请问下这是为什么!初学者!请指教!谢谢
展开