饥荒重生mod怎么用:高手看一个java 程序 错在哪里

来源:百度文库 编辑:杭州交通信息网 时间:2024/04/28 05:20:06
import java.awt.*;
import java.awt.event.*;
public class TestAddListener implements WindowListener,ActionListener{
Frame f;
Button b;
public void create(){
f=new Frame("Add Listners");
b=new Button("press me");
b.addActionListener(this);
f.addWindowListener(this);
f.add(b,"North");
f.setSize(200,200);
f.setVisible(true);
}
public static void main(String args[]){
TestAddListener ta = new TestAddListener();
ta.create();

}
public void actionPerformed(ActionEvent e){
System.out.println("the Button is pressed");
}
public void windowActivated(WindowEvent e){
}
public void windowDeactivated(WindowEvent e){
}
public void windowClosed(WindowEvent e){
}
public void windowclosing(WindowEvent e){System.exit(1);
}

public void windowIconified(WindowEvent e){
}
public void windowDeiconified(WindowEvent e){
}
public void windowOpened(WindowEvent e){
}
}

public void windowclosing(WindowEvent e){System.exit(1);
}
改成
public void windowClosing(WindowEvent e){System.exit(1);
}
就对了
closing的c大写

好像没有什么错吧
我运行了可以正常通过啊..........

而且Applet也出现了啊,当点击button时后台输出字符串啊...........