It's good that you've solved your problem. Don't forget to read the difference between == and equals()