als(\))){
JOptionPane.showMessageDialog(null,\用户不存在或输入错误!\); }
} catch (Exception e1) { e1.printStackTrace(); } } });
an2.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { jt1.setText(null);
password1.setText(null); jt1.requestFocus(); } });
/*添加组件*/ mb2.add(jl2);
mb3.add(jl3); mb3.add(jt1);
mb4.add(jl4); mb4.add(password1); mb5.add(an1); mb5.add(an2); mb1.add(mb2); mb1.add(mb3); mb1.add(mb4); mb1.add(mb5); /*设置窗体属性*/
this.setTitle(\用户登录\); this.setSize(300, 200); Dimension
screenSize=Toolkit.getDefaultToolkit().getScreenSize();
this.setLocation((screenSize.width-this.getWidth())/2,(screenSize.height-this.getHeight())/2); this.setResizable(false);
this.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
this.getLayeredPane().add(jl1,new Integer(Integer.MIN_VALUE)); } }
运行结果如下: