JOptionPane.showMessageDialog的使用
2013-10-04 15:20
344 查看
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) { IUserDao iUser = new UserDaoImp(); String userName = this.jTextField1.getText(); String userId = this.jTextField2.getText(); int id = Integer.parseInt(userId); User user = new User(); user.setName(userName); user.setId(id); boolean b = iUser.validate(user); if(b) JOptionPane.showMessageDialog(this, "验证成功"); else JOptionPane.showMessageDialog(this, "数据不存在"); } private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) { String sex = "女"; IUserDao iUser = new UserDaoImp(); String userName = this.jTextField1.getText(); String userId = this.jTextField2.getText(); int id = Integer.parseInt(userId); String age = this.jComboBox1.getSelectedItem().toString(); int age2 = Integer.parseInt(age); if (this.jRadioButton1.isSelected()) sex = this.jRadioButton1.getText(); User newUser = new User(id, userName, sex, age2); int j = iUser.insertOneUser(newUser); if (j == 1) JOptionPane.showMessageDialog(this, "注册成功"); else JOptionPane.showMessageDialog(this,"此数据已经存在"); }
相关文章推荐
- Swing中弹出对话框的几种方式_JOptionPane.showMessageDialog等详解
- javax.swing.JOptionPane.showMessageDialog() 方法
- Swing中弹出对话框的几种方式_JOptionPane.showMessageDialog等详解
- Swing中弹出对话框的几种方式_JOptionPane.showMessageDialog等详解
- javax.swing.JOptionPane.showMessageDialog() 方法
- javax.swing.JOptionPane.showMessageDialog() 方法
- (java)Swing中弹出对话框的几种方式_JOptionPane.showMessageDialog
- javax.swing.JOptionPane.showMessageDialog() 方法
- Swing中弹出对话框的几种方式_JOptionPane.showMessageDialog等详解
- javax.swing.JOptionPane.showMessageDialog() 方法
- Swing 写的客户端程序在java web start 运行,多语言过程中,JOptionPane.showMessageDialog() 按钮多语言问题
- javax.swing.JOptionPane.showMessageDialog() 方法
- 弹出警告对话框JOptionPane.showMessageDialog
- JOptionPane.showMessageDialog(null," ")中的null 含义
- Swing中弹出对话框的几种方式_JOptionPane.showMessageDialog等详解
- javax.swing.JOptionPane.showMessageDialog() 方法(转:执着的笨蛋—BlogJava)
- 如何JOPtionPane的showConfirmDialog对话框button设置监视器
- JOptionpane.showinputdialog 数据异常 处理
- 使用showMessageDialog显示消息框
- 使用showMessageDialog显示消息框