是否可以在无线工具包 2.5.2 中将 lwuit.Dialog 与 javax.microedition.lcdui.Canvas 一起使用?

发布于 2024-12-23 03:22:13 字数 539 浏览 2 评论 0原文

我正在使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

橘虞初梦 2024-12-30 03:22:13

我想说这是可能的,但它会显着增加应用程序的大小。每当您需要对话框时,您都可以初始化 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.

残疾 2024-12-30 03:22:13

我的想法是创建一个用户定义的项目,它从对话框的 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文