dmjlsl 原创,仅供交流。
如有疑问,或指点,请联系 QQ:403310405
f=new Font(t[67],Font.BOLD,16);
n=new JButton[10];
box1=Box.createVerticalBox();
box2=Box.createHorizontalBox();
box3=Box.createVerticalBox();
panel1=new JPanel();
panel2=new JPanel();
tishi=new JLabel(" 欢迎使用 XX银行!请输入卡号。 ");
tishi.setFont(f);
username=new JTextField(20);
password=new JPasswordField(20);
panel1.setLayout(new GridLayout(3,3));
panel2.setLayout(new GridLayout(4,1));
for(i=1;i<n.length;i++)
{
n[i]=new JButton(""+i);
panel1.add(n[i]);
n[i].addActionListener(this);
}
n[0]=new JButton("0");
panel1.add(n[0]);
n[0].addActionListener(this);
n[0].setPreferredSize(new Dimension(20,20));
queding=new JButton(" 确定");
chaxun=new JButton(" 查询");// 用户输入账号和密码后,点击查询按钮登陆
qukuan=new JButton(" 取款");
tuichu=new JButton(" 退出");
qukuan.show(false);
chaxun.show(false);// 初始化窗口后,账号和密码还没输入,不能用查询按
钮登陆
box1.add(tishi);
tishi.setBounds(50,10,290,60);
box1.add(username);
username.setBounds(50,60,300,20);
password.setBounds(60,60,300,20);
panel2.add(queding);
panel2.add(chaxun);
panel2.add(qukuan);
panel2.add(tuichu);
评论0
最新资源