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

📄 list.html

📁 J2ME MIDP2.0 final specification
💻 HTML
📖 第 1 页 / 共 4 页
字号:
<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="List(java.lang.String, int)"><!-- --></A><H3>List</H3><PRE>public <B>List</B>(String&nbsp;title,            int&nbsp;listType)</PRE><DL><DD>Creates a new, empty <code>List</code>, specifying its title and the type of the list.<DD><DL><DT><B>Parameters:</B><DD><CODE>title</CODE> - the screen's title (see <A HREF="../../../javax/microedition/lcdui/Displayable.html"><CODE>Displayable</CODE></A>)<DD><CODE>listType</CODE> - one of <code>IMPLICIT</code>, <code>EXCLUSIVE</code>, or <code>MULTIPLE</code><DT><B>Throws:</B><DD><CODE>IllegalArgumentException</CODE> - if <code>listType</code> is not one of <code>IMPLICIT</code>, <code>EXCLUSIVE</code>, or <code>MULTIPLE</code><DT><B>See Also: </B><DD><A HREF="../../../javax/microedition/lcdui/Choice.html"><CODE>Choice</CODE></A></DL></DD></DL><HR><A NAME="List(java.lang.String, int, java.lang.String[], javax.microedition.lcdui.Image[])"><!-- --></A><H3>List</H3><PRE>public <B>List</B>(String&nbsp;title,            int&nbsp;listType,            String[]&nbsp;stringElements,            <A HREF="../../../javax/microedition/lcdui/Image.html">Image</A>[]&nbsp;imageElements)</PRE><DL><DD>Creates a new <code>List</code>, specifying its title, the type of the <code>List</code>, and an array of <code>Strings</code> and <code>Images</code> to be used as its initial contents. <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>List</code>. The <code>imageElements</code> array may be <code>null</code> to indicate that the <code>List</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>List</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>title</CODE> - the screen's title (see <A HREF="../../../javax/microedition/lcdui/Displayable.html"><CODE>Displayable</CODE></A>)<DD><CODE>listType</CODE> - one of <code>IMPLICIT</code>, <code>EXCLUSIVE</code>, or <code>MULTIPLE</code><DD><CODE>stringElements</CODE> - set of strings specifying the string parts of the <code>List</code> elements<DD><CODE>imageElements</CODE> - set of images specifying the image parts of the <code>List</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 null 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>listType</code> is not one of <code>IMPLICIT</code>, <code>EXCLUSIVE</code>, or <code>MULTIPLE</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></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>Gets the number of elements in the <code>List</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>List</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/List.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 <code>null</code> if there is no image<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/List.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>List</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>List</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 List.<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> - index to 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>List</code> that is selected.<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/List.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>List</code> and returns the state of all elements in the boolean array <code>selectedArray_return</code>.<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>Choice</code><DT><B>Throws:</B><DD><CODE>IllegalArgumentException</CODE> - if <code>selectedArray_return</code> is shorter than the size of the List<DD><CODE>NullPointerException</CODE> - if <code>selectedArray_return</code> is <code>null</code><DT><B>See Also: </B><DD><A HREF="../../../javax/microedition/lcdui/List.html#setSelectedFlags(boolean[])"><CODE>setSelectedFlags(boolean[])</CODE></A></DL></DD></DL><HR><A NAME="setSelectedIndex(int, boolean)"><!-- --></A><H3>setSelectedIndex</H3><PRE>public void <B>setSelectedIndex</B>(int&nbsp;elementNum,                             boolean&nbsp;selected)</PRE><DL><DD>Sets the selected state of an element.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../../javax/microedition/lcdui/Choice.html#setSelectedIndex(int, boolean)">setSelectedIndex</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, starting from zero<DD><CODE>selected</CODE> - the state of the element, where <code>true</code> means

⌨️ 快捷键说明

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