0

I want to set LWUIT TextField constraint to Number and Password. I make TextField by

TextField tf=new TextField();

tf.setConstraints(TextArea.NUMBER|TextField.PASSWORD);

tf.setInputModeOrder(new String[ ] {"123"} );

I use virtual keyboard for input to this textfield. When I press this textfiled, alphabat virtual keyboard appear and can type alphabat like a to z and other symbol.

How can I set this textfield that only appear numeric virtual keyboard?

bharath
  • 14,283
  • 16
  • 57
  • 95
AT07
  • 98
  • 1
  • 11
  • Why you edit your question? you can ask new topic. Because I already answered for your previous question. – bharath Sep 23 '11 at 06:26

1 Answers1

1

Use like this for both numeric and password in the TextField,

textField.setConstraint(TextArea.NUMERIC | TextField.PASSWORD);
textField.setInputModeOrder(new String[]{"123"});
bharath
  • 14,283
  • 16
  • 57
  • 95
  • This should work on non touch mobiles. But it didn't work on touch mobiles. I asked this issue in [new topic.](http://stackoverflow.com/questions/7579142/why-numeric-constraint-didnt-work-on-virtual-keyboard-in-lwuit) – bharath Sep 28 '11 at 06:29
  • Look the answer on [my question.](http://stackoverflow.com/questions/7579142/why-numeric-constraint-didnt-work-on-virtual-keyboard-in-lwuit) – bharath Sep 30 '11 at 06:35