LUWIT 中已弃用的错误

发布于 2024-10-11 17:24:35 字数 264 浏览 7 评论 0原文

方法 命令监听器(动作监听器)来自 不推荐使用 Form 类型。

当我导入这个时,上面的错误开始出现。

导入com.sun.lwuit.Form;

Form f = new Form("你好,LWUIT!");

f.show(); f.setCommandListener(this); //这一行有错误。

The method
CommandListener(ActionListener) from
the type Form is deprecated.

the above error started coming when I imported this.

import com.sun.lwuit.Form;

Form f = new Form("Hello, LWUIT!");

f.show();
f.setCommandListener(this); //error in this line.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

枉心 2024-10-18 17:24:36

弃用是警告而不是错误,它通常包括对其发生原因的解释。在这种特殊情况下,setCommandListener API 被替换为 add/removeCommandListener API,以允许每个表单有多个侦听器。
在即将发布的 LWUIT 版本中,setCommandListener 将不再存在(只需将其替换为 addCommandListener)。

Deprecation is a warning not an error and it usually includes an explanation of why it is happening. In this particular case the setCommandListener API was replaced with an add/removeCommandListener API to allow multiple listeners per form.
In the upcoming LWUIT version setCommandListener will no longer exist (just replace it with addCommandListener).

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