开发者

LWUIT j2me textfield

开发者 https://www.devze.com 2023-03-18 09:17 出处:网络
how can I create a TextField ..plz help me out in LWUIT TextField pin = new TextField (\"\",TextField.PASSWORD|TextField.URL);

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

TextField pin = new TextField ("",TextField.PASSWORD|TextField.URL);
cashpayform.addComponent(pin);
cas开发者_Go百科hpayform.show();
 cashpayform.addCommand(exit);
        cashpayform.setCommandListener(this);
 cashpayform.show();


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();


TextField tf = new TextField();
tf.setConstraint(TextArea.PASSWORD | TextArea.URL);

make sure that TextField and Form are classes of lwuit

0

精彩评论

暂无评论...
验证码 换一张
取 消