Two Laptop Bag*
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 Murach's Java Servlets and JSP this week in the Servlets forum!
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: 3419
    
  12
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: GUI and Strings
 
Similar Threads
Methods
Mortage Calculator
Looping correctly
BufferedReader help
Help with creating GUI Error Messages.