private void btnUpdateActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnUpdateActionPerformed
// TODO add your handling code here:
    try {

        boolean check1 = txtMember_First_Name.getText().equals("") || txtMember_sur_Name1.getText().equals("") || txtMember_Mobile_Number.getText().equals("") || txtHome_telephone_Number.getText().equals("") || txtAddress.getText().equals("");
        System.out.println("X= " + check1);
        if (!check1) {
            if (txtHome_telephone_Number.getText().length() != 10) {
                JOptionPane.showMessageDialog(null, "Home Telephone number must have 10 digits");
            } else if (txtMember_Mobile_Number.getText().length() != 10) {
                JOptionPane.showMessageDialog(null, "Mobile Telephone number must have 10 digits");
            } else {
                DB.myConnection().createStatement().executeUpdate("update members set MemberSurname='" + txtMember_sur_Name1.getText() + "',MemberMiddleName='" + txtMember_Middle_Name.getText() + "',MemberFirstName='" + txtMember_First_Name.getText() + "',MemberAddress='" + txtAddress.getText() + "',MemberMobileNumber='" + txtMember_Mobile_Number.getText() + "',MemberHomeTelephone='" + txtHome_telephone_Number.getText() + "',MemberMotherName='" + txtMother_Name.getText() + "',MemberFatherName='" + txtMember_Father_Name.getText() + "',RegisteredDate='" + lblDate.getText() + "',SchoolAdmissionNumber='" + txtSchool_Admission_Number.getText() + "',LibrianID='" + LID + "' where MemberID='" + txtMemberID.getText() + "'");
                txtAddress.setText("");
                txtHome_telephone_Number.setText("");
                txtMemberID.setText("");
                txtMember_Father_Name.setText("");
                txtMember_First_Name.setText("");
                txtMember_Middle_Name.setText("");
                txtMember_Mobile_Number.setText("");
                txtMember_sur_Name1.setText("");
                txtMother_Name.setText("");
                txtSchool_Admission_Number.setText("");
                lblDate.setText("");
                lblRegisterLibrianName.setText("");
                btnEdit.setEnabled(false);
                btnEdit.setText("Edit");
                btnUpdate.setEnabled(false);
                jButton1.setEnabled(true);
                txtAddress.setEditable(false);
                txtHome_telephone_Number.setEditable(false);
                txtMember_Father_Name.setEditable(false);
                txtMember_First_Name.setEditable(false);
                txtMember_Middle_Name.setEditable(false);
                txtMember_Mobile_Number.setEditable(false);
                txtMember_sur_Name1.setEditable(false);
                txtMother_Name.setEditable(false);
                txtSchool_Admission_Number.setEditable(false);
                txtMemberID.setEditable(true);
                txtMemberID.grabFocus();
            }
        } else {
            JOptionPane.showMessageDialog(null, "Members must have First Name,Surname, mobile and home telephone numbers and Member Address");
        }

    } catch (Exception e) {
        JOptionPane.showMessageDialog(null, "Error @ member Register  exception");
    }

}//GEN-LAST:event_btnUpdateActionPerformed