View Single Post
  #1 (permalink)  
Old 06-07-2007, 05:52 PM
Spitfire Spitfire is offline
Newbie
 
Join Date: Jun 2007
Posts: 4
Rep Power: 0
Spitfire is on a distinguished road
Default Question about String handling...

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.
Reply With Quote

Sponsored Links