|
||||||
| 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 |
| John | ........ | 223.00000 |
| dargueta | ........ | 168.00000 |
| Xav | ........ | 164.00000 |
| LogicKills | ........ | 20.00000 |
| gaylo565 | ........ | 18.00000 |
| WingedPanther | ........ | 15.00000 |
| |pH| | ........ | 15.00000 |
| Johnnyboy | ........ | 3.00000 |
| navghost | ........ | 1.00000 |
Goal: 100,000 Posts
Complete: 67%