File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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


JavaRanch » Java Forums » Java » Beginning Java
Bookmark "GUI and Strings" Watch "GUI and Strings" New topic
Author

GUI and Strings

Graham Robinson
Greenhorn

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
Rancher

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


Joanne
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
Greenhorn

Joined: Nov 23, 2005
Posts: 16
Cheers, it works.
 
jQuery in Action, 2nd edition
 
subject: GUI and Strings