本文介绍了如何简单的表单字段添加到黑莓应用程序吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
假设我有一个从MainScreen继承的类,我怎么把一对夫妇表单字段的用户输入?
解决方案
//内部构造 LABEL1的LabelField =新的LabelField(的Hello World演示,LabelField.ELLIPSIS | LabelField.USE_ALL_WIDTH); EditField中firstNameEditField =新EditField中(EditField.NO_NEWLINE | EditField.NON_SPELLCHECKABLE | EditField.NO_COMPLEX_INPUT); EditField中lastNameEditField =新EditField中(EditField.NO_NEWLINE | EditField.NON_SPELLCHECKABLE | EditField.NO_COMPLEX_INPUT); ButtonField字段提交按钮=新ButtonField字段(提交)
{
保护布尔navigationClick(INT的地位,诠释时间)
{
的onSubmit(); 返回true;
}
}; this.add(LABEL1);
this.add(firstNameEditField);
this.add(lastNameEditField);
this.add(提交按钮);
Assuming I have a class inherited from MainScreen, how do I put up a couple of form fields for user input?
解决方案
// Inside the constructor
LabelField label1 = new LabelField("Hello World Demo" , LabelField.ELLIPSIS | LabelField.USE_ALL_WIDTH);
EditField firstNameEditField = new EditField(EditField.NO_NEWLINE | EditField.NON_SPELLCHECKABLE | EditField.NO_COMPLEX_INPUT);
EditField lastNameEditField = new EditField(EditField.NO_NEWLINE | EditField.NON_SPELLCHECKABLE | EditField.NO_COMPLEX_INPUT);
ButtonField submitButton = new ButtonField("Submit")
{
protected boolean navigationClick(int status, int time)
{
onSubmit();
return true;
}
};
this.add(label1);
this.add(firstNameEditField);
this.add(lastNameEditField);
this.add(submitButton);
这篇关于如何简单的表单字段添加到黑莓应用程序吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!