I'm scanning a text file in order to find two sequential words that are equal with my own. If I find them I'll display a window. Βut I can't make it work. I am pretty sure the problem is in this part of the code. I'm pretty novice in Java
so any help would be much appreciated.
public void readFile(String a, String b){
s=new Scanner("userDataStorage.txt");
while (s.hasNext()){
String u= s.next();
String p=s.next();
if(a==u&&b==p){
l.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
l.setSize(400,300);
l.setVisible(true);
}
}
}