如何在 Lwuit 命令中包含 Check?
您好,除了显示屏上的命令之外,我想添加一个检查(如刻度线)。有什么方法可以实现它吗?
Hi I want to include a check (as in a tick mark) besides the command on the display screen.IS there any way I can implement it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以通过实现 ListCellRenderer 接口来创建新类,或者使用 DefaultListCellRenderer 类进行扩展。然后实现所有抽象方法并重写 getListCellRendererComponent 方法,如下所示,
供您参考:链接。
最后,您需要将此渲染器类传递给 setMenuRenderer 方法。
对于单一形式意味着这样做,
对于所有形式意味着这样做,
You can create the new class with implement the ListCellRenderer interface or extend with DefaultListCellRenderer class. Then implement all abstract methods and override getListCellRendererComponent method like this,
For your reference see this link.
Finally you need to pass this renderer class to setMenuRenderer method.
For single form means do like this,
For all form means do like this,