I wana compare a String with the Key of a Hashmap.
So every time i run this code it uotputs : Not found
I'm new at Java and its surely a little thing but i need help.
Here my code
btnNewButton.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
if(!txtSearchHere.getText().isEmpty() && txtSearchHere.getText().length() > 1)
{
String value = txtSearchHere.getText();
txtSearchHere.setText("");
for(Integer key : plzHashMap.keySet())
{
if(key.toString() == value)
{
System.out.println("Matched key = " + value);
}
else
{
System.out.println("Not found");
}
}
}
}
});