舞法天女朵蜜舞蹈视频:myframe is not abstract and does not override abstract method actionPerformed~~

来源:百度文库 编辑:高校问答 时间:2024/04/16 23:11:01
代码如下 就是运行的时候出现上面的错误 请各位高手解答
import java.awt.*;
import java.awt.event.*;
public class myframe extends Frame implements ActionListener
{
Button btn;
myframe(){
//super("Frame button");
btn=new Button();
//setVisible(ture);
btn.setBackground(Color.yellow);
btn.setForeground(Color.black);
add(btn);
pack();
// btn.addActionListener(this);
}
public void action(ActionEvent e){
if(e.getSource()==btn){
System.exit(0);
}
}
public static void main(String args[]){

myframe my=new myframe();

}
}