📄 choicegroup.html
字号:
<CODE> int</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/microedition/lcdui/ChoiceGroup.html#getSelectedFlags(boolean[])">getSelectedFlags</A></B>(boolean[] selectedArray_return)</CODE><BR> Queries the state of a <code>ChoiceGroup</code> and returns the state of all elements in the boolean array <code>selectedArray_return</code>.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> int</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/microedition/lcdui/ChoiceGroup.html#getSelectedIndex()">getSelectedIndex</A></B>()</CODE><BR> Returns the index number of an element in the <code>ChoiceGroup</code> that is selected.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> String</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/microedition/lcdui/ChoiceGroup.html#getString(int)">getString</A></B>(int elementNum)</CODE><BR> Gets the <code>String</code> part of the element referenced by <code>elementNum</code>.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/microedition/lcdui/ChoiceGroup.html#insert(int, java.lang.String, javax.microedition.lcdui.Image)">insert</A></B>(int elementNum, String stringPart, <A HREF="../../../javax/microedition/lcdui/Image.html">Image</A> imagePart)</CODE><BR> Inserts an element into the <code>ChoiceGroup</code> just prior to the element specified.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/microedition/lcdui/ChoiceGroup.html#isSelected(int)">isSelected</A></B>(int elementNum)</CODE><BR> Gets a boolean value indicating whether this element is selected.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/microedition/lcdui/ChoiceGroup.html#set(int, java.lang.String, javax.microedition.lcdui.Image)">set</A></B>(int elementNum, String stringPart, <A HREF="../../../javax/microedition/lcdui/Image.html">Image</A> imagePart)</CODE><BR> Sets the <code>String</code> and <code>Image</code> parts of the element referenced by <code>elementNum</code>, replacing the previous contents of the element.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/microedition/lcdui/ChoiceGroup.html#setFitPolicy(int)">setFitPolicy</A></B>(int fitPolicy)</CODE><BR> Sets the application's preferred policy for fitting <code>Choice</code> element contents to the available screen space.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/microedition/lcdui/ChoiceGroup.html#setFont(int, javax.microedition.lcdui.Font)">setFont</A></B>(int elementNum, <A HREF="../../../javax/microedition/lcdui/Font.html">Font</A> font)</CODE><BR> Sets the application's preferred font for rendering the specified element of this <code>Choice</code>.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/microedition/lcdui/ChoiceGroup.html#setSelectedFlags(boolean[])">setSelectedFlags</A></B>(boolean[] selectedArray)</CODE><BR> Attempts to set the selected state of every element in the <code>ChoiceGroup</code>.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/microedition/lcdui/ChoiceGroup.html#setSelectedIndex(int, boolean)">setSelectedIndex</A></B>(int elementNum, boolean selected)</CODE><BR> For <code>ChoiceGroup</code> objects of type <code>MULTIPLE</code>, this simply sets an individual element's selected state.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> int</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/microedition/lcdui/ChoiceGroup.html#size()">size</A></B>()</CODE><BR> Returns the number of elements in the <code>ChoiceGroup</code>.</TD></TR></TABLE> <A NAME="methods_inherited_from_class_javax.microedition.lcdui.Item"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TD><B>Methods inherited from class javax.microedition.lcdui.<A HREF="../../../javax/microedition/lcdui/Item.html">Item</A></B></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><A HREF="../../../javax/microedition/lcdui/Item.html#addCommand(javax.microedition.lcdui.Command)">addCommand</A>, <A HREF="../../../javax/microedition/lcdui/Item.html#getLabel()">getLabel</A>, <A HREF="../../../javax/microedition/lcdui/Item.html#getLayout()">getLayout</A>, <A HREF="../../../javax/microedition/lcdui/Item.html#getMinimumHeight()">getMinimumHeight</A>, <A HREF="../../../javax/microedition/lcdui/Item.html#getMinimumWidth()">getMinimumWidth</A>, <A HREF="../../../javax/microedition/lcdui/Item.html#getPreferredHeight()">getPreferredHeight</A>, <A HREF="../../../javax/microedition/lcdui/Item.html#getPreferredWidth()">getPreferredWidth</A>, <A HREF="../../../javax/microedition/lcdui/Item.html#notifyStateChanged()">notifyStateChanged</A>, <A HREF="../../../javax/microedition/lcdui/Item.html#removeCommand(javax.microedition.lcdui.Command)">removeCommand</A>, <A HREF="../../../javax/microedition/lcdui/Item.html#setDefaultCommand(javax.microedition.lcdui.Command)">setDefaultCommand</A>, <A HREF="../../../javax/microedition/lcdui/Item.html#setItemCommandListener(javax.microedition.lcdui.ItemCommandListener)">setItemCommandListener</A>, <A HREF="../../../javax/microedition/lcdui/Item.html#setLabel(java.lang.String)">setLabel</A>, <A HREF="../../../javax/microedition/lcdui/Item.html#setLayout(int)">setLayout</A>, <A HREF="../../../javax/microedition/lcdui/Item.html#setPreferredSize(int, int)">setPreferredSize</A></CODE></TD></TR></TABLE> <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TD><B>Methods inherited from class java.lang.Object</B></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE>equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD></TR></TABLE> <P><!-- ============ FIELD DETAIL =========== --><!-- ========= CONSTRUCTOR DETAIL ======== --><A NAME="constructor_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Constructor Detail</B></FONT></TD></TR></TABLE><A NAME="ChoiceGroup(java.lang.String, int)"><!-- --></A><H3>ChoiceGroup</H3><PRE>public <B>ChoiceGroup</B>(String label, int choiceType)</PRE><DL><DD>Creates a new, empty <code>ChoiceGroup</code>, specifying its title and its type. The type must be one of <code>EXCLUSIVE</code>, <code>MULTIPLE</code>, or <code>POPUP</code>. The <code>IMPLICIT</code> choice type is not allowed within a <code>ChoiceGroup</code>.<DD><DL><DT><B>Parameters:</B><DD><CODE>label</CODE> - the item's label (see <A HREF="../../../javax/microedition/lcdui/Item.html"><CODE>Item</CODE></A>)<DD><CODE>choiceType</CODE> - <code>EXCLUSIVE</code>, <code>MULTIPLE</code>, or <code>POPUP</code><DT><B>Throws:</B><DD><CODE>IllegalArgumentException</CODE> - if <code>choiceType</code> is not one of <code>EXCLUSIVE</code>, <code>MULTIPLE</code>, or <code>POPUP</code><DT><B>See Also: </B><DD><A HREF="../../../javax/microedition/lcdui/Choice.html#EXCLUSIVE"><CODE>Choice.EXCLUSIVE</CODE></A>, <A HREF="../../../javax/microedition/lcdui/Choice.html#MULTIPLE"><CODE>Choice.MULTIPLE</CODE></A>, <A HREF="../../../javax/microedition/lcdui/Choice.html#IMPLICIT"><CODE>Choice.IMPLICIT</CODE></A>, <A HREF="../../../javax/microedition/lcdui/Choice.html#POPUP"><CODE>Choice.POPUP</CODE></A></DL></DD></DL><HR><A NAME="ChoiceGroup(java.lang.String, int, java.lang.String[], javax.microedition.lcdui.Image[])"><!-- --></A><H3>ChoiceGroup</H3><PRE>public <B>ChoiceGroup</B>(String label, int choiceType, String[] stringElements, <A HREF="../../../javax/microedition/lcdui/Image.html">Image</A>[] imageElements)</PRE><DL><DD>Creates a new <code>ChoiceGroup</code>, specifying its title, the type of the <code>ChoiceGroup</code>, and an array of <code>Strings</code> and <code>Images</code> to be used as its initial contents. <p>The type must be one of <code>EXCLUSIVE</code>, <code>MULTIPLE</code>, or <code>POPUP</code>. The <code>IMPLICIT</code> type is not allowed for <code>ChoiceGroup</code>.</p> <p>The <code>stringElements</code> array must be non-null and every array element must also be non-null. The length of the <code>stringElements</code> array determines the number of elements in the <code>ChoiceGroup</code>. The <code>imageElements</code> array may be <code>null</code> to indicate that the <code>ChoiceGroup</code> elements have no images. If the <code>imageElements</code> array is non-null, it must be the same length as the <code>stringElements</code> array. Individual elements of the <code>imageElements</code> array may be <code>null</code> in order to indicate the absence of an image for the corresponding <code>ChoiceGroup</code> element. Non-null elements of the <code>imageElements</code> array may refer to mutable or immutable images.</p><DD><DL><DT><B>Parameters:</B><DD><CODE>label</CODE> - the item's label (see <A HREF="../../../javax/microedition/lcdui/Item.html"><CODE>Item</CODE></A>)<DD><CODE>choiceType</CODE> - <code>EXCLUSIVE</code>, <code>MULTIPLE</code>, or <code>POPUP</code><DD><CODE>stringElements</CODE> - set of strings specifying the string parts of the <code>ChoiceGroup</code> elements<DD><CODE>imageElements</CODE> - set of images specifying the image parts of the <code>ChoiceGroup</code> elements<DT><B>Throws:</B><DD><CODE>NullPointerException</CODE> - if <code>stringElements</code> is <code>null</code><DD><CODE>NullPointerException</CODE> - if the <code>stringElements</code> array contains any <code>null</code> elements<DD><CODE>IllegalArgumentException</CODE> - if the <code>imageElements</code> array is non-null and has a different length from the <code>stringElements</code> array<DD><CODE>IllegalArgumentException</CODE> - if <code>choiceType</code> is not one of <code>EXCLUSIVE</code>, <code>MULTIPLE</code>, or <code>POPUP</code><DT><B>See Also: </B><DD><A HREF="../../../javax/microedition/lcdui/Choice.html#EXCLUSIVE"><CODE>Choice.EXCLUSIVE</CODE></A>,
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -