View Single Post
Old November 6th, 2012, 03:33 AM   #1 (permalink)
Cr4a
New Member
Thread Author (OP)
 
Join Date: Nov 2012
Posts: 4
 
Device(s):
Carrier: Not Provided

Thanks: 3
Thanked 0 Times in 0 Posts
Default getting text from a textfield

hiho, we are trying to get the text from a textfield and convert this string to a int/double value but it doesnt work. here is our code

public void Addieren()
{
string hallo = zahl1.getText();
double d1 = Double.parseDouble(zahl1.getText());

double d2 = Double.parseDouble(zahl2.getText());

double ergebnis = d1-d2;
ausgabe.setText = ergebnis.toString();

}

zahl1, zahl2 are the two textfield ids.

thx in advance
Cr4a is offline  
Reply With Quote