编译出错,不解?请高手指点。
源码:
import javax.swing.*;
import java.awt.event.*;
import java.awt.*;
class Undo
{
JFrame frame;
public void Undo(String str){
frame = new JFrame(str);
frame.addWindowListener(new WindowAdapter(){public void windowClosing(WindowEvent e){System.exit(0);}});
frame.getContentPane().setLayout(null);
frame.setSize(300,400);
frame.setVisible(true);
}
public static void main(String[] args)
{
Undo n=new Undo("Undo");
}
}
出错信息:constructor中的参数数量错误。
Undo n= new Undo("Undo");
^