AT07
AT07

Reputation: 98

How to set numeric virtual keyboard only for LWUIT TextField that constraint with Password and Numeric?

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?

Upvotes: 0

Views: 1057

Answers (1)

bharath
bharath

Reputation: 14463

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

textField.setConstraint(TextArea.NUMERIC | TextField.PASSWORD);
textField.setInputModeOrder(new String[]{"123"});

Upvotes: 1

Related Questions