【问题标题】:CodeName One, Action event not working- need explanationCodeName 一、Action 事件不起作用-需要解释
【发布时间】:2013-04-10 13:49:31
【问题描述】:

我正在尝试在我的 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);    
}

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

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

我仍然一无所获。我已经寻找其他关于如何使用代号的教程,但我找不到任何。我没有得到作者制作的那个。如果有人能给我留言,我将不胜感激。

【问题讨论】:

    标签: java mobile user-interface codenameone


    【解决方案1】:

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多