代号一-动作事件 [英] Codename One -- action event

查看:110
本文介绍了代号一-动作事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在一个代号项目中,假设我在NetBeans上创建了项目 PRJ1,
我定义了一个我不应该作为动作事件的文件。

In a Codename One project, say project "PRJ1" i created on NetBeans, I defined a file that i shouldn't have as an Action event.

具体来说,在设计器界面中编辑 theme.res
(我使用的是NetBeans& Codename One的最新版本),单击
a按钮,然后在下拉菜单事件->动作事件中,输入
a .jar文件。

Specifically, in the designer interface to edit "theme.res" (I'm using the latest version of NetBeans & Codename One), I right-clicked a button, then in the drop-down menu Events -> Action event, entered a .jar file.

此后,我一直报错:

Error opening Netbeans.java.IOException: Cannot run program "..\MyApp.jar" CreateProcess error=193, %1 is not a valid Win32 application 

每当我接近事件时。

我删除了PRJ1,并从头开始创建了PRJ2。
当我尝试以相同的方式再次定义动作事件
时,单击动作事件或其他任何事件后,我在弹出窗口中都遇到了相同的错误。当我在新项目中定义新组件时,我也有相同的东西
。 MyApp.jar似乎永久停留在我的代号One上。我无法摆脱它。

I deleted PRJ1 and created a PRJ2 from scratch. When i tried to define an action event again the same way, i ended up with the same error in the pop-up window right after I clicked Action event or any other one of the events. i've got the same thing when i define a new component on a new project. "MyApp.jar" seems to have stuck on my Codename One for good. i'm not being able to get rid of it.

我的问题是:

我如何仅对源代码定义操作,而无需使用设计器界面?

当我使用设计器界面定义动作事件时,
如何进入代码?我看到了StateMachine.java中添加的方法。
据我所知,就源代码而言,这就是全部。 .xml或其他配置文件中的任何地方还有其他更改吗?我手动搜索了项目目录中的文件。在任何地方都没有MyApp.jar的痕迹。

When I define an action event the way i did by using the designer interface, how does this get into the code? I'm seeing the methods added in the StateMachine.java. From what i see, that is all there is as far as the source code goes. Is there anything else changing anywhere in .xml or other confign files? I manually searched the files in the project directory. No trace of MyApp.jar anywhere.

预先感谢。

我是Codename One的新手。这可能是一个简单的Q,但是却花了我很多时间。

I'm new to Codename One. This may be a simple Q, but burned so much of my time.

推荐答案

您需要启动设计器,点击File- >设置NetBeans,然后从NetBeans bin目录中选择netbeans.exe / .app.sh文件,以便设计人员可以触发NetBeans。

You need to launch the designer, click File->Setup NetBeans and select netbeans.exe/.app.sh file from the NetBeans bin directory so the designer can trigger NetBeans.

您可以在向导中创建一个手工编码的应用程序。 (底部的第二个选项),其中设计器仅用于主题,而不用于GUI。您可以像在任何组件上的Swing / AWT addActionListner 等中一样处理事件。

You can create a handcoded application in the Wizard (second option on the bottom) where the designer is only used for the theme and not the GUI. You can handle events just like you do in Swing/AWT addActionListner etc. on any component.

这篇关于代号一-动作事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆