1
votes

how can I create a TextField ..plz help me out in LWUIT

TextField pin = new TextField ("",TextField.PASSWORD|TextField.URL);
cashpayform.addComponent(pin);
cashpayform.show();
 cashpayform.addCommand(exit);
        cashpayform.setCommandListener(this);
 cashpayform.show();
2

2 Answers

4
votes

Use this code,

 Form form = new Form("Sample");
 form.setLayout(new BoxLayout(BoxLayout.Y_AXIS));
 TextField textField = new TextField();
 textField.setConstraint(TextField.PASSWORD | TextField.URL);
 textField.setMaxSize(100);
 form.addComponent(textField);
 form.addCommand(new Command("Exit") {

     public void actionPerformed(ActionEvent evt) {
         notifyDestroyed();
     }
 });
 form.show();
3
votes
TextField tf = new TextField();
tf.setConstraint(TextArea.PASSWORD | TextArea.URL);

make sure that TextField and Form are classes of lwuit