|
||||||
| Java Help Java Help forum discussing all Java platforms - J2ME, J2SE and J2EE - as well as relevant standards, APIs and frameworks such as Swing, Servlets, JSPs, Applets, Struts, Spring, Hibernate, ANT, EJB, and other Java-related topics. |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|||
|
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();
}
|
| Sponsored Links |
|
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| VB6.0:Tutorial, Error handling | TcM | VB Tutorials | 9 | 06-06-2008 01:31 PM |
| need help in counting a specify character in a string. | lichy | Perl | 2 | 06-27-2007 10:03 PM |
| Class question in Delphi | tosh5457 | Pascal/Delphi | 4 | 06-11-2007 01:46 PM |
| [Help] String manipulation. | afiser | Visual Basic Programming | 1 | 05-31-2007 03:24 PM |
| Is string in array? | smith | Perl | 2 | 02-14-2007 01:30 PM |
| Xav | ........ | 1097.16 |
| MeTh0Dz|Reb0rn | ........ | 986.37 |
| morefood2001 | ........ | 850.04 |
| John | ........ | 841.93 |
| WingedPanther | ........ | 684.54 |
| marwex89 | ........ | 638.26 |
| Brandon W | ........ | 493.36 |
| chili5 | ........ | 292.12 |
| Steve.L | ........ | 188.37 |
| orjan | ........ | 187.41 |
Goal: 100,000 Posts
Complete: 79%