import java.awt.*;
import java.awt.event.*;
public class canxu implements ActionListener{
static Font fnt=new Font("Serief",Font.BOLD,22);
static Frame frm=new Frame();
static Button bn=new Button("关闭");
static Label lb1=new Label("余额:");
static Label lb2=new Label("帐号:");
static Label lb3=new Label("户名:");
static Label lb4=new Label("开户日期:");
static Label lb5=new Label("帐户类型:");
static TextField tfd1=new TextField(14);
static TextField tfd2=new TextField(14);
static TextField tfd3=new TextField(14);
static TextField tfd4=new TextField(14);
static TextField tfd5=new TextField(14);
public canxu(){
frm.setLayout(null);//取消布局后TextField居然不能编辑了
frm.setBounds(250,200,350,400);
frm.setBackground(Color.lightGray);
lb1.setBounds(60,30,100,50);
tfd1.setBounds(110,40,200,30);
lb2.setBounds(60,90,100,50);
tfd2.setBounds(110,100,200,30);
lb3.setBounds(60,150,100,50);
tfd3.setBounds(110,160,200,30);
lb4.setBounds(0,210,160,50);
tfd4.setBounds(110,220,200,30);
lb5.setBounds(0,270,160,50);
tfd5.setBounds(110,280,200,30);
bn.setBounds(160,350,50,30);
frm.add(lb1);
frm.add(tfd1);
frm.add(lb2);
frm.add(tfd2);
frm.add(lb3);
frm.add(tfd3);
frm.add(lb4);
frm.add(tfd4);
frm.add(lb5);
frm.add(tfd5);
frm.add(bn);
lb1.setFont(fnt);
lb2.setFont(fnt);
lb3.setFont(fnt);
lb4.setFont(fnt);
lb5.setFont(fnt);
tfd1.setFont(fnt);
tfd2.setFont(fnt);
tfd3.setFont(fnt);
tfd4.setFont(fnt);
tfd5.setFont(fnt);
bn.setFont(fnt);
bn.addActionListener(this);
frm.setVisible(true);
}
public void actionPerformed(ActionEvent e){
frm.dispose();//关闭窗口并释放资源
}
public static void main(String args[]){
new canxu();
}
}