从组合框中删除项目 lwuit?
如何从 LWUIT 中的组合框中删除所有项目或单个项目?
是否有像 removeall()
这样的函数?
How to remove all items or a single item from a combo box in LWUIT ?
Is there any functions like removeall()
?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
使用
getModel().removeItem(index)
并从ComboBox
中删除该项目。请参阅示例代码,如果要删除所有项目,则需要在
combobox.setModel(model)
上设置空的ListModel
或传递空的Vector
在ComboBox
构造函数上。Use
getModel().removeItem(index)
and remove the item's fromComboBox
. See the sample code,If you want to remove all item means set the empty
ListModel
oncombobox.setModel(model)
or pass the emptyVector
onComboBox
constructor.删除lwuit中组合框中的所有项目,示例代码如下:
Deleting the all the items from combobox in lwuit,sample code given below: