I have been playing with Java for a few months now and i have a question. I have noticed that java seems to be a little tempremental with strings in logical statements. Im no expert but i im no newbie either, so i was wondering if someone could tell me how to do this. For example, using javas swing package, comparing the contents of a text field to a string variable to make something happen
Code:
if(txtField.getText() == STRING_VAR){
somethingHappens();
}
When I try to use strings in this way, things never happen as they should.