I have an infinite loop that waits for a method to update a boolean, and while this seems to all work fine at school it doesn't work at home. Not sure if that really means it's computer-based or what, since it also works with the print statement in there.
while(running){
//System.out.println(running);
}
...
public static void passwordCheck(String pass){
if(pass.equals(password)){
correctPW = true;
}
else if(pass.equals(overKey))
PWCoder.override(password);
running = false;
}
...
public void actionPerformed(ActionEvent e){
String temp = new String("");
for(int x=0;x<passwordInput.getPassword().length;x++)
temp+=passwordInput.getPassword()[x];
PWCoder.passwordCheck(temp);
}
As I said, this code works with the print statement uncommented, but that's rather ugly. What I'm going for here is a password screen that you type it in, if you're wrong a different window opens(code not shown), or you can type the override password which calls the override method. I've used many debug statements, running gets set to false in the method, I guess the while loop just doesn't pick it up. Sorry the code is a tad out of order. While loop with problem, method that should get the loop to end, and the method in another class that calls said method.