Java me J2me上的ChoiceGroup始终在选定第一个索引的情况下呈现

Java me J2me上的ChoiceGroup始终在选定第一个索引的情况下呈现,java-me,Java Me,是否有一种方法,使用本机j2me选项组总是在未选择索引的情况下显示它?注意:选项可以突出显示,但不一定要选择。使用类型为MULTIPLE和setSelectedFlags的ChoiceGroup对象,如下所示: public class myMIDlet extends MIDlet implements ItemStateListener ... { ... ChoiceGroup cg = new ChoiceGroup("cg", Choice.MULTIPLE); Form form;

是否有一种方法,使用本机j2me选项组总是在未选择索引的情况下显示它?注意:选项可以突出显示,但不一定要选择。

使用类型为MULTIPLEsetSelectedFlags的ChoiceGroup对象,如下所示:

public class myMIDlet extends MIDlet implements ItemStateListener ... {
...
ChoiceGroup cg = new ChoiceGroup("cg", Choice.MULTIPLE);
Form form;
...
public myMIDlet(){

cg.append("Element1", null);
cg.append("Element2", null);
cg.append("Element3", null);
cg.setSelectedFlags(new boolean[]{false, false, false});
form = new Form("form", new Item[]{cg});
form.setItemStateListener(this);
}
...
public void itemStateChanged (Item item){
cg.setSelectedFlags(new boolean[]{false, false, false});
}   
}
setSelectedFlags方法尝试设置ChoiceGroup中每个元素的选定状态。对于类型为MULTIPLE的ChoiceGroup对象,这将设置选项中每个元素的选定状态。可以选择任意数量的元素。
itemStateChanged(Item Item)在用户更改项目的内部状态时调用