//以下是我的LoginPanel按钮代码,我想把输出的user.getCidId() 传到第二个Swing (MainPanel)的JLabel
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
String at = log_a.getText();
// int i = Integer.parseInt(at);
String bt = new String(log_b.getPassword());
boolean b = true;
if (at.equals("")) {
log_check_a.setText("卡号不能为空");
b = false;
}
if (bt.equals("")) {
log_check_b.setText("密码不能为空");
b = false;
}
Users user = new Users();
user.setCidId(at);
user.setPassWord(bt);
UsersService usersService = new UsersService();
Users u = usersService.loging(user);
if (at.equals(user.getCidId())) {
System.out.println("卡号:" + user.getCidId() + "\n" + "已登录银行系统!");
MainPanel.main(null);
dispose();
} else {
System.out.println("登录失败");
JOptionPane.showConfirmDialog(null, "卡号或密码不正确,如需帮助请拨打热线");
}
}
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here: 卡户跳转
RegPanel.main(null);
dispose();
}
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new LoginPanel().setVisible(true);
}
});
}
元芳怎么了
翻过高山走不出你
随时随地看视频慕课网APP
相关分类