⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 choicegroup.html

📁 J2ME MIDP2.0 final specification
💻 HTML
📖 第 1 页 / 共 4 页
字号:
<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><!-- ============ METHOD DETAIL ========== --><A NAME="method_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Method Detail</B></FONT></TD></TR></TABLE><A NAME="size()"><!-- --></A><H3>size</H3><PRE>public int <B>size</B>()</PRE><DL><DD>Returns the number of elements in the <code>ChoiceGroup</code>.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../../javax/microedition/lcdui/Choice.html#size()">size</A></CODE> in interface <CODE><A HREF="../../../javax/microedition/lcdui/Choice.html">Choice</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>the number of elements in the <code>ChoiceGroup</code></DL></DD></DL><HR><A NAME="getString(int)"><!-- --></A><H3>getString</H3><PRE>public String <B>getString</B>(int&nbsp;elementNum)</PRE><DL><DD>Gets the <code>String</code> part of the element referenced by <code>elementNum</code>.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../../javax/microedition/lcdui/Choice.html#getString(int)">getString</A></CODE> in interface <CODE><A HREF="../../../javax/microedition/lcdui/Choice.html">Choice</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>elementNum</CODE> - the index of the element to be queried<DT><B>Returns:</B><DD>the string part of the element<DT><B>Throws:</B><DD><CODE>IndexOutOfBoundsException</CODE> - if <code>elementNum</code> is invalid<DT><B>See Also: </B><DD><A HREF="../../../javax/microedition/lcdui/ChoiceGroup.html#getImage(int)"><CODE>getImage(int)</CODE></A></DL></DD></DL><HR><A NAME="getImage(int)"><!-- --></A><H3>getImage</H3><PRE>public <A HREF="../../../javax/microedition/lcdui/Image.html">Image</A> <B>getImage</B>(int&nbsp;elementNum)</PRE><DL><DD>Gets the <code>Image</code> part of the element referenced by <code>elementNum</code>.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../../javax/microedition/lcdui/Choice.html#getImage(int)">getImage</A></CODE> in interface <CODE><A HREF="../../../javax/microedition/lcdui/Choice.html">Choice</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>elementNum</CODE> - the number of the element to be queried<DT><B>Returns:</B><DD>the image part of the element, or null if there is no image<DT><B>Throws:</B><DD><CODE>IndexOutOfBoundsException</CODE> - if elementNum is invalid<DT><B>See Also: </B><DD><A HREF="../../../javax/microedition/lcdui/ChoiceGroup.html#getString(int)"><CODE>getString(int)</CODE></A></DL></DD></DL><HR><A NAME="append(java.lang.String, javax.microedition.lcdui.Image)"><!-- --></A><H3>append</H3><PRE>public int <B>append</B>(String&nbsp;stringPart,                  <A HREF="../../../javax/microedition/lcdui/Image.html">Image</A>&nbsp;imagePart)</PRE><DL><DD>Appends an element to the <code>ChoiceGroup</code>.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../../javax/microedition/lcdui/Choice.html#append(java.lang.String, javax.microedition.lcdui.Image)">append</A></CODE> in interface <CODE><A HREF="../../../javax/microedition/lcdui/Choice.html">Choice</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>stringPart</CODE> - the string part of the element to be added<DD><CODE>imagePart</CODE> - the image part of the element to be added, or <code>null</code> if there is no image part<DT><B>Returns:</B><DD>the assigned index of the element<DT><B>Throws:</B><DD><CODE>NullPointerException</CODE> - if <code>stringPart</code> is <code>null</code></DL></DD></DL><HR><A NAME="insert(int, java.lang.String, javax.microedition.lcdui.Image)"><!-- --></A><H3>insert</H3><PRE>public void <B>insert</B>(int&nbsp;elementNum,                   String&nbsp;stringPart,                   <A HREF="../../../javax/microedition/lcdui/Image.html">Image</A>&nbsp;imagePart)</PRE><DL><DD>Inserts an element into the <code>ChoiceGroup</code> just prior to the element specified.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../../javax/microedition/lcdui/Choice.html#insert(int, java.lang.String, javax.microedition.lcdui.Image)">insert</A></CODE> in interface <CODE><A HREF="../../../javax/microedition/lcdui/Choice.html">Choice</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>elementNum</CODE> - the index of the element where insertion is to occur<DD><CODE>stringPart</CODE> - the string part of the element to be inserted<DD><CODE>imagePart</CODE> - the image part of the element to be inserted, or <code>null</code> if there is no image part<DT><B>Throws:</B><DD><CODE>IndexOutOfBoundsException</CODE> - if <code>elementNum</code> is invalid<DD><CODE>NullPointerException</CODE> - if <code>stringPart</code> is <code>null</code></DL></DD></DL><HR><A NAME="delete(int)"><!-- --></A><H3>delete</H3><PRE>public void <B>delete</B>(int&nbsp;elementNum)</PRE><DL><DD>Deletes the element referenced by <code>elementNum</code>.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../../javax/microedition/lcdui/Choice.html#delete(int)">delete</A></CODE> in interface <CODE><A HREF="../../../javax/microedition/lcdui/Choice.html">Choice</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>elementNum</CODE> - the index of the element to be deleted<DT><B>Throws:</B><DD><CODE>IndexOutOfBoundsException</CODE> - if <code>elementNum</code> is invalid</DL></DD></DL><HR><A NAME="deleteAll()"><!-- --></A><H3>deleteAll</H3><PRE>public void <B>deleteAll</B>()</PRE><DL><DD>Deletes all elements from this <code>ChoiceGroup</code>.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../../javax/microedition/lcdui/Choice.html#deleteAll()">deleteAll</A></CODE> in interface <CODE><A HREF="../../../javax/microedition/lcdui/Choice.html">Choice</A></CODE></DL></DD></DL><HR><A NAME="set(int, java.lang.String, javax.microedition.lcdui.Image)"><!-- --></A><H3>set</H3><PRE>public void <B>set</B>(int&nbsp;elementNum,                String&nbsp;stringPart,                <A HREF="../../../javax/microedition/lcdui/Image.html">Image</A>&nbsp;imagePart)</PRE><DL><DD>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.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../../javax/microedition/lcdui/Choice.html#set(int, java.lang.String, javax.microedition.lcdui.Image)">set</A></CODE> in interface <CODE><A HREF="../../../javax/microedition/lcdui/Choice.html">Choice</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>elementNum</CODE> - the index of the element to be set<DD><CODE>stringPart</CODE> - the string part of the new element<DD><CODE>imagePart</CODE> - the image part of the element, or <code>null</code> if there is no image part<DT><B>Throws:</B><DD><CODE>IndexOutOfBoundsException</CODE> - if <code>elementNum</code> is invalid<DD><CODE>NullPointerException</CODE> - if <code>stringPart</code> is <code>null</code></DL></DD></DL><HR><A NAME="isSelected(int)"><!-- --></A><H3>isSelected</H3><PRE>public boolean <B>isSelected</B>(int&nbsp;elementNum)</PRE><DL><DD>Gets a boolean value indicating whether this element is selected.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../../javax/microedition/lcdui/Choice.html#isSelected(int)">isSelected</A></CODE> in interface <CODE><A HREF="../../../javax/microedition/lcdui/Choice.html">Choice</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>elementNum</CODE> - the index of the element to be queried<DT><B>Returns:</B><DD>selection state of the element<DT><B>Throws:</B><DD><CODE>IndexOutOfBoundsException</CODE> - if <code>elementNum</code> is invalid</DL></DD></DL><HR><A NAME="getSelectedIndex()"><!-- --></A><H3>getSelectedIndex</H3><PRE>public int <B>getSelectedIndex</B>()</PRE><DL><DD>Returns the index number of an element in the <code>ChoiceGroup</code> that is selected. For <code>ChoiceGroup</code> objects of type <code>EXCLUSIVE</code> and <code>POPUP</code> there is at most one element selected, so this method is useful for determining the user's choice. Returns <code>-1</code> if there are no elements in the <code>ChoiceGroup</code>.  <p>For <code>ChoiceGroup</code> objects of type <code>MULTIPLE</code>, this always returns <code>-1</code> because no single value can in general represent the state of such a <code>ChoiceGroup</code>. To get the complete state of a <code>MULTIPLE</code> <code>Choice</code>, see <A HREF="../../../javax/microedition/lcdui/ChoiceGroup.html#getSelectedFlags(boolean[])"><CODE>getSelectedFlags</CODE></A>.</p><DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../../javax/microedition/lcdui/Choice.html#getSelectedIndex()">getSelectedIndex</A></CODE> in interface <CODE><A HREF="../../../javax/microedition/lcdui/Choice.html">Choice</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>index of selected element, or <code>-1</code> if none<DT><B>See Also: </B><DD><A HREF="../../../javax/microedition/lcdui/ChoiceGroup.html#setSelectedIndex(int, boolean)"><CODE>setSelectedIndex(int, boolean)</CODE></A></DL></DD></DL><HR><A NAME="getSelectedFlags(boolean[])"><!-- --></A><H3>getSelectedFlags</H3><PRE>public int <B>getSelectedFlags</B>(boolean[]&nbsp;selectedArray_return)</PRE><DL><DD>Queries the state of a <code>ChoiceGroup</code> and returns the state of  all elements in the boolean array <code>selectedArray_return</code>. <strong>Note:</strong> this is a result parameter. It must be at least as long as the size of the <code>ChoiceGroup</code> as returned by <code>size()</code>. If the array is longer, the extra elements are set to <code>false</code>.  <p>For <code>ChoiceGroup</code> objects of type <code>MULTIPLE</code>, any number of elements may be selected and set to true in the result array.  For <code>ChoiceGroup</code> objects of type <code>EXCLUSIVE</code> and <code>POPUP</code>, exactly one element will be selected, unless there are zero elements in the <code>ChoiceGroup</code>. </p><DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../../javax/microedition/lcdui/Choice.html#getSelectedFlags(boolean[])">getSelectedFlags</A></CODE> in interface <CODE><A HREF="../../../javax/microedition/lcdui/Choice.html">Choice</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>selectedArray_return</CODE> - array to contain the results<DT><B>Returns:</B><DD>the number of selected elements in the <code>ChoiceGroup</code><DT><B>Throws:</B><DD><CODE>IllegalArgumentException</CODE> - if <code>selectedArray_return</code> is shorter than the size of the <code>ChoiceGroup</code><DD><CODE>NullPointerException</CODE> - if <code>selectedArray_return</code> is null<DT><B>See Also: </B><DD><A HREF="../../../javax/microedition/lcdui/ChoiceGroup.html#setSelectedFlags(boolean[])"><CODE>setSelectedFlags(boolean[])</CODE></A></DL>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -