从组合框lwuit中删除项目?

Gan*_*esh 1 java lwuit java-me lwuit-combobox

如何从LWUIT中的组合框中删除所有项目或单个项目?

有什么功能removeall()吗?

bha*_*ath 5

使用getModel().removeItem(index)和删除项目ComboBox.请参阅示例代码,

ComboBox c = new ComboBox(vector); // you can use ListModel or String[] instead of vector

// for remove single item in combobox
c.getModel().removeItem(index); // pass the removable index number
Run Code Online (Sandbox Code Playgroud)

如果你想删除所有项目的装置设置在空ListModelcombobox.setModel(model)或通过空VectorComboBox构造函数.