Hi all ;-) Situation: I'm writing an math application,and I need some fields in my GUI to enter the calculation params(lenght for example). The TextField with getText method (you have explained me grately) returns a String;I need the method read a double or int from the field to use in aplication's further calculations. How shall I do this? And what about sending the result back to my window? (setText or drawText use Strings too) Thank's very much.
Dominik To get an int or double from a string you'd use one of the wrapper classes. Check out the Integer and Double classes in the java.lang.Number package. Both of these classes have methods that will take a String value and return a primitive. For example to get a double from a String you would do somehting like this:
After that code the variable dbl will have the primitive double value of 2.456 Hope that helps
------------------ Dave Sun Certified Programmer for the Java� 2 Platform