In Java strings are not primitive data types, they are objects, and can therefor not be compared using the binary operator [wingedpanther may know why]. When comparing strings in Java use the .equals() function.
Code:
if(txtField.getText().equals(STRING_VAR)){
somethingHappens();
}