I'm writing a simple GUI program where I have to input login and password for user and then check if he is in database (my Hashmap). That's where i have problem. I checked if login is correct by containsKey and checked for password by containsValue. The problem is, that if in example I have 2 users:
login: user1 password: example login: user2 password: programing If I put login as user1 in my JTextField and password "programing", the program says, that it's correct.
That's where I have a problem. How to check the password for exact login, which is key?
Would be very thankful for any clues or solutions :)