JOptionPane.showMessageDialog(this, "用户名不允许为空图书预约系统代码java!", "cuowu", 0);
return;
}
try {
user = DAOFactory.getIUserDAOInstance().findById(name);
if (user != null) {
if (user.getPass() != nulluser.getPass().equals(pass)) {
GlobalUser.LOGIN_USER = user; // 记录当前用户
// 进入主界面
Main.start();
this.dispose();
} else {
JOptionPane.showMessageDialog(this, "用户名或密码错误!");
return;
}
}
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
if (user == null) {
JOptionPane.showMessageDialog(this, "用户名或密码错误!", "消息", 0);
return;
}
}
}
private void formKeyTyped(java.awt.event.KeyEvent evt) {
}
private void formKeyPressed(java.awt.event.KeyEvent evt) {
}
private void jTextField1ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
}
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
jTextField1.setText("");
jPasswordField1.setText("");
jTextField1.requestFocus();
}
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
String name = jTextField1.getText(); // 获取用户名
String pass = String.valueOf(jPasswordField1.getPassword());// 获取密码
User user = null;
// 未输入用户名
if (name.equals("")) {
JOptionPane.showMessageDialog(this, "用户名不允许为空图书预约系统代码java!");
return;
}
try {
user = DAOFactory.getIUserDAOInstance().findById(name);
if (user != null) {
if (user.getPass() != nulluser.getPass().equals(pass)) {
GlobalUser.LOGIN_USER = user; // 记录当前用户
// 进入主界面
Main.start();
this.dispose();
} else {
JOptionPane.showMessageDialog(this, "用户名或密码错误!", "消息", 0);
return;
}
}
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
if (user == null) {
JOptionPane.showMessageDialog(this, "用户名或密码错误!", "消息", 0);
return;
}
}
private void jMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) {
if (JOptionPane.showConfirmDialog(this, "图书预约系统代码java你确定要退出吗图书预约系统代码java?", "提示",
JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) {
System.exit(0);
}
}
private void jMenuItem1MouseClicked(java.awt.event.MouseEvent evt) {
System.exit(1);
}
/**
* @param args
*the command line arguments
*/
public static void main(String args[]) {
//System.out.println(Login.class.getResource("src/images/images/login_main.jpg"));
//new javax.swing.ImageIcon(
//Login.class.getResource("../../../../images/login_main.jpg"));
//new Login().setVisible(true);
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new Login().setVisible(true);
}
});
}
// GEN-BEGIN:variables
// Variables declaration - do not modify
private javax.swing.JButton jButton1;
private javax.swing.JButton jButton2;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JMenu jMenu1;
private javax.swing.JMenu jMenu2;
private javax.swing.JMenuBar jMenuBar1;
private javax.swing.JMenuItem jMenuItem1;
private javax.swing.JMenuItem jMenuItem2;
private javax.swing.JPasswordField jPasswordField1;
private javax.swing.JTextField jTextField1;
// End of variables declaration//GEN-END:variables
推荐阅读
- 这几年电商如何,电商怎么发展
- 英语表扬小程序怎么写,英语表扬小程序怎么写
- 手机b站看直播没画面,手机b站看直播没画面怎么办
- php无法显示数据库中文 php数据库启动不了
- 公众号不认证支付功能,公众号不认证支付功能会怎么样
- 百度文心ChatGPT人民网,百度文心ernie
- JAVA爬虫提高爬取速率,java爬虫需要的基本知识
- c语言函数求成绩 c语言求总成绩
- flash和html5区别,html5跟flash