NetBeans Forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
  

Problem stringItem.setText()

 
Post new topic   Reply to topic    NetBeans Forums -> Java ME Users
View previous topic :: View next topic  
Author Message
Fsirka



Joined: 16 Jul 2010
Posts: 1

PostPosted: Fri Jul 16, 2010 9:19 am    Post subject: Problem stringItem.setText() Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> Java ME Users All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo