import java.awt.*;
import java.awt.event.*;
public class bbb
{
   public static void main(String argc[])
{
            new AppFrame();
}
} class AppFrame extends Frame implements ActionListener
{
   TextField in=new TextField(6);
   Button btn=new Button("ok");
   Label out=new Label("           ");
   public AppFrame()
        {
    setLayout(new FlowLayout());
            add(in);
    add(btn);
    add(out);
    setSize(400,400);
            show();
            btn.addActionListener(this);
}
   public void actionperformed(ActionEvent e)
        {
            String s=in.getText();
            Double n=Double.parseDouble(s);
            Double qq=n*n*n;
    out.setText("wo ri"+qq);
}
} 编译时出现错误
---------------------------------------
bbb.java:11: AppFrame 不是抽象的,并且未覆盖 java.awt.eve
抽象方法 actionPerformed(java.awt.event.ActionEvent)
 class AppFrame extends Frame implements ActionListener 注意:bbb.java 使用或覆盖了已过时的 API。
注意:要了解详细信息,请使用 -Xlint:deprecation 重新编译。
--------------------------------------
高手帮忙解决啊    

解决方案 »

  1.   

    很明显,看看你的actionPerformed的名字写错了:
    public void actionPerformed(ActionEvent e) {    
    }我这个对的
      

  2.   

    同意楼上 就是actionPerformed中的p 要大写了
      

  3.   

    P改过来了   但还是有错
    --------------------------------注意:bbb.java 使用或覆盖了已过时的 API。
    注意:要了解详细信息,请使用 -Xlint:deprecation 重新编译。
    ----------------------------------------
      

  4.   

    show();方法已经过时了.用setVisible(true);-----------------------------------import java.awt.*;
    import java.awt.event.*;
    public class bbb
    {
       public static void main(String argc[])
    {
                new AppFrame();
    }
    } class AppFrame extends Frame implements ActionListener
    {
       TextField in=new TextField(6);
       Button btn=new Button("ok");
       Label out=new Label("           ");
       public AppFrame()
            {
        setLayout(new FlowLayout());
                add(in);
        add(btn);
        add(out);
        setSize(400,400);
                //show();
                setVisible(true);
                btn.addActionListener(this);
    }
       public void actionperformed(ActionEvent e)
            {
                String s=in.getText();
                Double n=Double.parseDouble(s);
                Double qq=n*n*n;
        out.setText("wo ri"+qq);
    }