Meaningless Drivel is fun!
The moose likes Java Micro Edition and the fly likes TextField with comma Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Mobile » Java Micro Edition
Bookmark "TextField with comma" Watch "TextField with comma" New topic

TextField with comma

Cosimo Muro

Joined: Mar 27, 2002
Posts: 2
Hi, I have a little problem with TextField.
I would use a TextField that allow to insert only numbers and comma symbol (or dot symbol).
Ther's some class that allow these operations?
Plese, reply me soon!!!
david russell

Joined: Feb 28, 2002
Posts: 14
hey, if you have the J2ME wireless tollkit installed, the MIDP API can be found under <j2mewtk root>\docs\api\index.html look up the index for t, textfield has a number of constraints that can be applied to texfields. the only ones that are suitable for you are probably email or numeric constraints. is it possible you could add in the comma or dot later?
Cosimo Muro

Joined: Mar 27, 2002
Posts: 2
Thank you for reply. I need that people inserts Euro value into a TextField. (i.e. 34,50)
If I use a Numeric Costrain, the comma is impossible to be insert. So, how I can identify the right position of the comma (or dot)?
Otherwise, if I use an Email Constrain the User can insert every kind of character. This is not a problem for me, but I would like to give a user-friendly Interface.
So if I need to insert the number value 3, I need to be able to push just one time the button 3, and not more times.
Have you or some one, an answare to this problem?
I agree. Here's the link:
subject: TextField with comma
It's not a secret anymore!