import java.awt.*;
import java.awt.event.*;
public class TestArithmetic {
public static void main(String[] args) {
MyFrame frm=new MyFrame();//错误在这行
frm.addWindowListener(new Monitor());
}
class MyFrame extends Frame{
public MyFrame(){
this.setTitle("TestCalculate");
this.setBounds(200, 200, 300, 300);
this.setBackground(Color.GRAY);
this.setResizable(false);
this.setVisible(true);
}
}
class Monitor extends WindowAdapter implements ActionListener{
public void windowClosing(WindowEvent e){
((Frame)e.getComponent()).dispose();
System.exit(0);
}
}
}
|