NetBeans Forums
| View previous topic :: View next topic |
| Author |
Message |
Fsirka
Joined: 16 Jul 2010 Posts: 1
|
Posted: Fri Jul 16, 2010 9:19 am Post subject: Problem stringItem.setText() |
|
|
I have a problem mobile applications
code:
else if (command == okCommand) {
int weight,percentage,price,result;
String s_weight,s_percentage,s_price,s_result;
s_weight=textField1.getString();
s_price=textField.getString();
s_percentage=textField2.getString();
weight=Integer.parseInt(s_weight);
percentage=Integer.parseInt(s_percentage);
price=Integer.parseInt(s_price);
result=10*price/(weight/percentage);
stringItem.setText("rhrhrhr"+result);
}
Problems
All the text fields are not null (textField="200";textField1=3;textField2=70)
result = 9
but when I press "OK" in mobil phone, then stringItem is null
Why ???
If I get object of stringItem in new form1 and I use "OK" for go from form to form1 , then it is good.
How can I do only once in form ? |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|