This week's book giveaway is in the Security forum.
We're giving away four copies of Securing DevOps and have Julien Vehent on-line!
See this thread for details.
Win a copy of Securing DevOps this week in the Security forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Storing user input in an integer variable  RSS feed

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi !

i m new to J2ME. I am making a calculator program. Can anybody tel me how to accept an integer from the user in a mobile.
 
ranger
Sheriff
Posts: 17314
11
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually it is really simple. Using a TextField, you can have it only accept numbers, using the constant NUMERIC in the constructor, the last parameter. the getString method will return the valueas a string and use the common methods of Integer class to get the int value back.

Mark
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!