刚学awt就有问题了,各位帮指点下?
/* date from 2006.12.15*/import java.awt.*;
import java.awt.event.*;
public class trans
{
public static void main(String argv[])
{
Frame f=new Frame("窗口");
TextField t=new TextField("文本区",12);
Button b=new Button("按钮");
f.setLayout(new BorderLayout(30,20));
f.add(t,BorderLayout.NORTH);
f.add(b,BorderLayout.CENTER);
f.addWindowListener(new W());
f.setSize=(300,100);
f.setResizable(false);
f.setVisible(true);
}
}
class W implements WindowListener
{
public void windowOpened(WindowEvent e){};
public void windowClosing(WindowEvent e){System.exit(0);};
public void windowClosed(WindowEvent e){};
public void windowIconified(WindowEvent e){};
public void windowDeiconified(WindowEvent e){};
public void windowActivated(WindowEvent e){};
public void windowDeactivated(WindowEvent e){};
}