Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void btnSignUpActionPerformed(java.awt.event.ActionEvent evt) {
- String nama = txtUserName.getText();
- String pass = txtPassword.getText();
- String pass1 = txtRetypePassword.getText();
- if(pass == null ? pass1 != null : !pass.equals(pass1)){
- JOptionPane.showMessageDialog(rootPane,
- "Password didn't match.",
- "Form Error",
- JOptionPane.WARNING_MESSAGE);
- txtUserName.setText("");
- txtPassword.setText("");
- txtRetypePassword.setText("");
- }else{
- try {
- DateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd");
- Date date = new Date();
- String tgl = dateFormat.format(date);
- int tambahUser = src.id.lib.insertData.insertUser(nama, pass, tgl);
- if(tambahUser == 1){
- JOptionPane.showMessageDialog(rootPane,
- "Creating user success.");
- }
- new Login().show();
- this.dispose();
- } catch (SQLException ex) {
- Logger.getLogger(Mahasiswa.class.getName()).log(Level.SEVERE, null, ex);
- }
- }
- }
- private void btnResetActionPerformed(java.awt.event.ActionEvent evt) {
- txtUserName.setText("");
- txtPassword.setText("");
- txtRetypePassword.setText("");
- }
- public static void main(String args[]) throws UnsupportedLookAndFeelException{
- UIManager.setLookAndFeel(new AcrylLookAndFeel());
- java.awt.EventQueue.invokeLater(new Runnable() {
- public void run() {
- new Registration().setVisible(true);
- }
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement