private void loginUser() 
  {
    custPswInt = JOptionPane.showConfirmDialog(null, custPanel,
        "Enter your username and password to login.",
        JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE);

    char pass[] = custPassField.getPassword();
    
    if (custPswInt == JOptionPane.OK_OPTION)        // If User clicks OK
    {
      // If login successfully
      if ((user = DBIO.login(custUserField.getText(), new String(pass))) != null) 
      {
        if (user instanceof Manager) // Add Manger tabs if the user logged in is a manager
        {
          isManager = true;          // Display the manager tab only on correct
          tabs.addTab("Manager", managerPanel);
          tabs.remove(search); // login
        } 
        else if (user instanceof Customer) 
        {
          search.add(custLogout);
          search.remove(loginButton);
          getCustCredit();

        }
        JOptionPane.showMessageDialog(this, "Welcome Back!");   // welcome message
      } 
      else 
      {
        JOptionPane.showMessageDialog(this, "Incorrect Password"); // error message
      }
    }
    
    for (int i = 0; i < pass.length; i++)   // ALWAYS reset text password for security
    {
      pass[i] = 0;
    }
    custUserField.setText("");              // clear the text fields
    custPassField.setText("");
  }