简体   繁体   中英

How to check whether a checkbox is checked or unchecked in J2ME?

如何检查J2ME中的复选框是选中还是未选中?

 boolean flags[] = new boolean[choiceBox.size()];
 choiceBox.getSelectedFlags(flags);  

Queries the state of a ChoiceGroup and returns the state of all elements in the boolean array selectedArray_return. NOTE: this is a result parameter. It must be at least as long as the size of the ChoiceGroup as returned by size(). If the array is longer, the extra elements are set to false.

For ChoiceGroup objects of type MULTIPLE, any number of elements may be selected and set to true in the result array. For ChoiceGroup objects of type EXCLUSIVE, exactly one element will be selected, unless there are zero elements in the ChoiceGroup.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM