This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes GUI and Strings Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "GUI and Strings" Watch "GUI and Strings" New topic

GUI and Strings

Graham Robinson

Joined: Nov 23, 2005
Posts: 16
Can't work out how to take them in, I've had it so it will work out the pounds to kilos, but can't seem to send it down. I've tried a few different strimgs etc, here is the code.

Joanne Neal

Joined: Aug 05, 2005
Posts: 3742
Use String.equals() method to compare Strings, not ==

Murad Iqbal
Ranch Hand

Joined: Dec 09, 2003
Posts: 90
1. What are you comparing 'name' and 'kilo' with? 'p' and 'k' are empty strings isnt it? So I suggest initialize them with something you would want to compare them with

2. As told earlier, for String comparison use .equals() method from the String class.
Graham Robinson

Joined: Nov 23, 2005
Posts: 16
Cheers, it works.
I agree. Here's the link:
subject: GUI and Strings
jQuery in Action, 3rd edition