title: Login User if values exist in HashMap
body: <p>Hey guys i am having a form in which user registers and then log's in. The data from the registration username and password are stored in a hashmap like this:</p>
  
  <pre><code>if (usersMap.containsKey("username")) {
      JOptionPane.showMessageDialog(LoginForm.this, "User already exists !", "ERROR", JOptionPane.ERROR_MESSAGE);
  } else {
      usersMap.put("username", registerUser.getText());
      usersMap.put("userpassword", registerPassword.getPassword());
      JOptionPane.showMessageDialog(LoginForm.this, "Registration Successful !!", "SUCCESS", JOptionPane.PLAIN_MESSAGE);
  }
  </code></pre>
  
  <p>I also check for duplicate entries in the username and it works fine</p>
  
  <p>The problemm occurs when i am trying to log the user in.</p>
  
  <p>Here is my login code:</p>
  
  <pre><code>private void clickEventRightPanel() {
          loginBtn.addActionListener(new ActionListener() {
  
              @Override
              public void actionPerformed(ActionEvent e) {
                  unameLog = loginUser.getText();
                  logPass = loginPassword.getPassword();
  
                  if (usersMap.values().contains(loginUser.getText()) &amp;&amp; usersMap.values().contains(loginPassword.getPassword())) {
                      JOptionPane.showMessageDialog(LoginForm.this, "Login sucessfull !!", "SUCCESS", JOptionPane.PLAIN_MESSAGE);
                  } else {
                      JOptionPane.showMessageDialog(LoginForm.this, "User does not exist ! Try again !", "ERROR", JOptionPane.ERROR_MESSAGE);
                  }
  
              }
          });
  
      }
  </code></pre>
  
  <p>Any ideas about what possibly could go wrong in here??</p>