我的程序如下:
import java.awt.*;
import java.awt.event.*;
//import javax.swing.*;
public class KK extends Frame implements ActionListener,WindowListener
{
public KK() {
super("QQ用户登录");
this.setSize(250,200);
this.setBackground(new Color(210,250,250));
this.setLocation(300,240);
this.setLayout(new FlowLayout());
this.add(new Label("QQ帐号"));
this.add(new TextField(20));
this.add(new Label("QQ密码"));
this.add(new TextField(20));
this.add(new Button("查杀木马"));
this.add(new Button("设置"));
this.add(new Button("登录"));
this.addWindowListener(new WinClose());
this.setVisible(true);
}
public static void main (String[] args) {
new KK();
}
}
class WinClose implements WindowListener
{
public void windowClosing(WindowEvent e)
{
System.exit(0);
}
public void windowOpened(WindowEvent e){}
}