Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/user-interface/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
User interface BlackBerry-ButtonField中的消费点击事件_User Interface_Events_Blackberry_Button - Fatal编程技术网

User interface BlackBerry-ButtonField中的消费点击事件

User interface BlackBerry-ButtonField中的消费点击事件,user-interface,events,blackberry,button,User Interface,Events,Blackberry,Button,我已经在blackberry中开发了UI应用程序。 在按钮单击事件上,我想显示添加两个数字的结果。 如何在Blackberry的java应用程序中处理此事件?在中使用单击事件的最佳选项是使用。只需实现FieldChangeListener接口并应用ButtonField.: FieldChangeListener的另一个选项是内联声明和实现它。这样,您就不必检查来自哪个字段的事件: mAddButtonField.setChangeListener(new FieldChange

我已经在blackberry中开发了UI应用程序。
在按钮单击事件上,我想显示添加两个数字的结果。

如何在Blackberry的java应用程序中处理此事件?

在中使用单击事件的最佳选项是使用。只需实现FieldChangeListener接口并应用ButtonField.:

FieldChangeListener的另一个选项是内联声明和实现它。这样,您就不必检查来自哪个字段的事件:

        mAddButtonField.setChangeListener(new FieldChangeListener() {
            public void fieldChanged(Field field, int context) {
                showAddResult();
            }
        });
或者

        mAddButtonField.setChangeListener(new FieldChangeListener() {
            public void fieldChanged(Field field, int context) {
                showAddResult();
            }
        });
add(new ButtonField("Click Me")) {  
  protected boolean navigationClick(int status, int time) {  
    showAddResult();  
    return true;  
  }  
});