CodeName One,Action事件不起作用 - 需要解释

时间:2013-04-10 13:49:32

标签: java mobile user-interface codenameone

我正试图让我的HelloWorld上的动作事件发生。即时通讯使用GUI,当它自动创建:

protected void onMain_Button1Action(Component c, ActionEvent event) {
    // If the resource file changes the names of components this call will break notifying you that you should fix the code
    super.onMain_Button1Action(c,event);    
}

我知道它不会起作用,因为超类中没有相同类型的空白。

protected void onMain_Button1Action(Component c, ActionEvent event) {
    // If the resource file changes the names of components this call will break notifying you that you should fix the code
    Dialog.show("Test", "it works", "OK",null);
}

我仍然一无所获。我已经找了关于如何使用代号的其他教程,但我找不到。我不会得到作者制作的那个。如果有人能折腾我,我会非常感激。

1 个答案:

答案 0 :(得分:1)

您需要在设计器中保存资源文件,而不是删除对super的调用。如果您使用的是Eclipse,则应在使用F5保存在设计器中后刷新项目。