If You want to make a TextField with calculator
(only adding and 1 number, if you press on 5 it
show 5 then 6 it show 11 then 3 it show 14 aso)
and then use this code
int oldnumber =0;
public void itemStateChanged(Item item){
if (item instanceof TextField){
TextField text=(TextField)item;
int newNumber=oldNumber+Integer.parseInt(text.getString().substring(text.getString().length()-1,text.getString().length()));
oldnumber=newnumber;
text.setString(""+newNumber);
so works it with Suns emulator but not in Nokia 6630. Why?

Reply With Quote



