private void btnEditOthersActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnEditOthersActionPerformed
        // TODO add your handling code here:
        lblHint.setVisible(false);
        Pattern namepattern = Pattern.compile("^[A-Z][a-zA-Z ,.'-]*$");
        String fn = tbxFirstName.getText().trim();
        if (!namepattern.matcher(fn).matches())
        {
            tbxError.setText("Invalid first name.");
            lblHint.setText("Unacceptable first name.");
            lblHint.setVisible(true);
            return ;
        }
        fn = fn.replace("'", "\\'");
        String ln = tbxLastName.getText().trim();
        if (!namepattern.matcher(ln).matches())
        {
            tbxError.setText("Invalid last name.");
            lblHint.setText("Unacceptable last name.");
            lblHint.setVisible(true);
            return ;
        }
        ln = ln.replace("'", "\\'"); 
        //String fn = tbxFirstName.getText().trim().replace("'", "\\'");
        //if (fn.equals(""))
        //{
        //    tbxError.setText("Empty first name.");
        //    return ;
        //}
        //String ln = tbxLastName.getText().trim().replace("'", "\\'");
        //if (ln.equals(""))
        //{
        //    tbxError.setText("Empty last name.");
        //    return ;
        //}
        Pattern pattern = Pattern.compile("[0-9]{4}/[0-9]{2}/[0-9]{2}");
        Pattern pattern2 = Pattern.compile("[0-9]{2}/[0-9]{2}/[0-9]{4}");
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd");
        Date bd = new Date();
        String tbd = tbxBirthDate.getText();
        if (pattern.matcher(tbd).matches())
        {
            //bd = sdf.parse(tbxBirthDate.getText());
            sdf = new SimpleDateFormat("yyyy/MM/dd");
        }
        else if (pattern2.matcher(tbd).matches())
        {
            sdf = new SimpleDateFormat("MM/dd/yyyy");
        }
        else
        {
            tbxError.setText("Invalid birthdate.");
            lblHint.setText("Wrong Format. Example: "+"2000/01/01");
            lblHint.setVisible(true);
            return ;
        }
        try
        {
            bd = sdf.parse(tbxBirthDate.getText());
        }
        catch(Exception e)
        {
            tbxError.setText("Invalid birthdate.");
            lblHint.setText("Wrong Format. Example: "+"2000/01/01");
            lblHint.setVisible(true);
            return ;
        }
        String Address = tbxAddress1.getText().replace("'", "\\'").replace(";", "");
        Address +=";";
        Address += tbxAddress2.getText().replace("'", "\\'").replace(";", "");
        if (Address.equals(";"))
        {
            tbxError.setText("Empty address.");
            return ;
        }
        pattern = Pattern.compile("[0-9]{5}");
        
        String zc = tbxZipcode.getText().trim().replace("'", "");
        if (!pattern.matcher(zc).matches())
        {
            tbxError.setText("Invalid zipcode.");
            lblHint.setText("Wrong Format. Example: "+"25858");
            lblHint.setVisible(true);
            return ;
        }
        
        String ph = tbxPhone.getText().trim().replace("'", "");
        pattern = Pattern.compile("[0-9]{3}\\-?[0-9]{3}\\-?[0-9]{4}");
        if (!pattern.matcher(ph).matches())
        {
            tbxError.setText("Invalid phone number.");
            lblHint.setText("Wrong Format. Example: "+"919-360-5662");
            lblHint.setVisible(true);
            return ;
        }
        ph = ph.replace("-", "");
        ph = ph.substring(0,3)+"-"+ph.substring(3,6)+"-"+ph.substring(6);
        
        User_Controller UC = new User_Controller("localhost", DBName, DBAccount, DBPwd);
        boolean flag = UC.UpdateUser(ThisUser.UserID, fn, ln, bd, Address, zc, ph);
        if (flag)
        {
            tbxError.setText("Update succeccful.");
        }
        else
        {
            tbxError.setText(UC.err);
        }
        try
        {
            ThisUser = (User)UC.SearchUser(ThisUser.UserID, "ID").get(0);
        }
        catch(Exception e)
        {
            ThisUser = new User();
        }
        ShowInfo();
    }