为什么下面中的public void frame1() 中加上void就会出现C:\Documents and Settings\Administrator\桌面\Class1.java:12: call to super must be first statement in constructor super("我的应用程序");的错误?不加没有什么事,为什么?
import java.awt.*;
import java.awt.event.*;
class frame1 extends Frame implements ActionListener
{
public (void )frame1()
{
super("我的应用程序");
setLayout(new FlowLayout(FlowLayout.LEFT));
setBackground(Color.blue);
setSize(500,500);
setLocation(100,100);
add(new Button("确定"));
add(new Button("取消"));
Button btn=new Button("退出");
add(btn);
btn.addActionListener(this);
add(new Label("请输入数据:",Label.CENTER));
add (new TextField("文本框",10));
setVisible(true);
validate();
}
public void actionPerformed(ActionEvent e)
{
System.exit(0);
}
}
public class Class1
{
public static void main(String args[])
{
new frame1();
}
}