Ejemplo n.º 1
0
  private boolean checkbirth(String birthString) {
    Date bDay = new Date();
    if (!IOValidation.dateValid(birthString)) {
      JOptionPane.showMessageDialog(
          null, "Wrong Format! Please enter again", " ", JOptionPane.WARNING_MESSAGE);
      return false;
    } else {
      String[] dateSplit = birthString.split("-");
      int year = Integer.parseInt(dateSplit[0]);
      int month = Integer.parseInt(dateSplit[1]);
      int day = Integer.parseInt(dateSplit[2]);
      if (month < 0 || month > 12) {
        JOptionPane.showMessageDialog(
            null,
            "Wrong Format! Month cannot be less than 1 or more than 12! ",
            " ",
            JOptionPane.WARNING_MESSAGE);
        return false;
      } else if (day < 0 || day > 31) {
        JOptionPane.showMessageDialog(null, "Wrong Format! ", " ", JOptionPane.WARNING_MESSAGE);
        return false;
      } else {

      }
      return true;
    }
  }
Ejemplo n.º 2
0
 private boolean checkphone(String phoneString) {
   if (!IOValidation.phoneValid(phoneString)) {
     JOptionPane.showMessageDialog(
         null, "Phone not accept! Please enter again.", " ", JOptionPane.WARNING_MESSAGE);
     return false;
   } else return true;
 }
Ejemplo n.º 3
0
 private boolean checkemail(String emailString) {
   if (!IOValidation.emailValid(emailString)) {
     JOptionPane.showMessageDialog(
         null, "Email not accept! Please enter again.", " ", JOptionPane.WARNING_MESSAGE);
     return false;
   } else {
     return true;
   }
 }
Ejemplo n.º 4
0
 // checking function/////////////////////////////////////////////
 private boolean checkname(String userString) {
   if (!IOValidation.usernameValid(userString)) {
     JOptionPane.showMessageDialog(
         null, "User name not accept! Please enter again.", " ", JOptionPane.WARNING_MESSAGE);
     return false;
   } else {
     return true;
   }
 }