LUWIT 中已弃用的错误
方法 命令监听器(动作监听器)来自 不推荐使用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
弃用是警告而不是错误,它通常包括对其发生原因的解释。在这种特殊情况下,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).