下面就是代码: Form form = new Form("") ; TextField textPhone = new TextField("","",10,TextField .ANY) ; textPhone.setPreferredSize(form.getWidth(), form .getHeight());