是否可以在无线工具包 2.5.2 中将 lwuit.Dialog 与 javax.microedition.lcdui.Canvas 一起使用?
我正在使用 javax.microedition.lcdui.Canvas 在屏幕上绘制字符串。但出于某种目的,我还需要一个对话框窗口。因此,我使用 lwuit
包(com.sun.lwuit.Dialog
)在按键时显示对话框窗口。
因此,在我的程序中,我只是包含该包并创建对话框的对象。运行我的应用程序时,它意外终止。
我刚刚添加了以下几行...
import javax.microedition.lcdui.Canvas;
import com.sun.lwuit.Dialog;
public class Mycanvas extends Canvas implements CommandListener
{
Dialog dialog = new Dialog();
//some other remaining codes for my canvas...
}
那么,是否可以使用 lcdui
画布显示 lwuit
对话框窗口?
I am using javax.microedition.lcdui.Canvas
for drawing my string on the screen. But I also need one dialog window for some purpose. So I am using lwuit
package (com.sun.lwuit.Dialog
) for showing dialog window when key pressing.
So in my program I just included that package and create the object of the Dialog box. While running my application, it is terminated unexpectedly.
I just included the following lines...
import javax.microedition.lcdui.Canvas;
import com.sun.lwuit.Dialog;
public class Mycanvas extends Canvas implements CommandListener
{
Dialog dialog = new Dialog();
//some other remaining codes for my canvas...
}
So, is it possible to show lwuit
dialog window with lcdui
canvas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我想说这是可能的,但它会显着增加应用程序的大小。每当您需要对话框时,您都可以初始化 LWUIT 显示并使用 LWUIT 表单和对话框。
我最好自己实现一些非常简单的对话框。这并不是什么工作。或者使用其他第三方解决方案。
I would say it's possible but it will increase size of the app significantly. Whenever you need your dialog you can init LWUIT Display and use LWUIT Forms and Dialogs.
I would better to implement some really simple Dialog ourselves. It's not really much work. Or use another third party solution.
我的想法是创建一个用户定义的项目,它从对话框的 CustomItem 扩展。但是很难编写完整的实现代码。最好搜索任何已经实现对话框的第三方 jar 文件。
My Idea is create an user defined Item which extends from CustomItem for dialog.But it is difficult to code the complete implementation.Better u search for any third pary jar file which already implemented dialog box.