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

📄 choice.html

📁 是MIDP 的API 查詢文件, 大家可以看一下裡面的index.html, 再用Package 或 Class 名字來查.
💻 HTML
📖 第 1 页 / 共 4 页
字号:
public static final int <B>EXCLUSIVE</B></PRE>
<DL>
<DD><code>EXCLUSIVE</code> is a choice having exactly one element selected at time.  All elements of an <code>EXCLUSIVE</code> type <code>Choice</code> should be displayed in-line.  That is, the user should not need to perform any extra action to traverse among and select from the elements. <P>Value <code>1</code> is assigned to <code>EXCLUSIVE</code>.</P></DL>
<HR>

<A NAME="MULTIPLE"><!-- --></A><H3>
MULTIPLE</H3>
<PRE>
public static final int <B>MULTIPLE</B></PRE>
<DL>
<DD><code>MULTIPLE</code> is a choice that can have arbitrary number of elements selected at a time. <P>Value <code>2</code> is assigned to <code>MULTIPLE</code>.</P></DL>
<HR>

<A NAME="IMPLICIT"><!-- --></A><H3>
IMPLICIT</H3>
<PRE>
public static final int <B>IMPLICIT</B></PRE>
<DL>
<DD><code>IMPLICIT</code> is a choice in which the currently focused element is selected when a <A HREF="../../../javax/microedition/lcdui/Command.html"><CODE>Command</CODE></A> is initiated. <P>The <code>IMPLICIT</code> type is not valid for <A HREF="../../../javax/microedition/lcdui/ChoiceGroup.html"><CODE>ChoiceGroup</CODE></A> objects.</P> <P>Value <code>3</code> is assigned to <code>IMPLICIT</code>.</P></DL>
<HR>

<A NAME="POPUP"><!-- --></A><H3>
POPUP</H3>
<PRE>
public static final int <B>POPUP</B></PRE>
<DL>
<DD><code>POPUP</code> is a choice having exactly one element selected at a time.  The selected element is always shown.  The other elements should be hidden until the user performs a particular action to show them.  When the user performs this action, all elements become accessible.  For example, an implementation could use a popup menu to display the elements of a <code>ChoiceGroup</code> of type <code>POPUP</code>. <P>The <code>POPUP</code> type is not valid for <A HREF="../../../javax/microedition/lcdui/List.html"><CODE>List</CODE></A> objects.</P> <P>Value <code>4</code> is assigned to <code>POPUP</code>.</P><DD><DL>
<DT><B>Since: </B><DD>MIDP 2.0</DD>
</DL>
</DD>
</DL>
<HR>

<A NAME="TEXT_WRAP_DEFAULT"><!-- --></A><H3>
TEXT_WRAP_DEFAULT</H3>
<PRE>
public static final int <B>TEXT_WRAP_DEFAULT</B></PRE>
<DL>
<DD>Constant for indicating that the application has no preference as to  wrapping or truncation of text element contents and that the  implementation should use its default behavior. <p>Field has the value <code>0</code>.</p><DD><DL>
<DT><B>See Also: </B><DD><A HREF="../../../javax/microedition/lcdui/Choice.html#getFitPolicy()"><CODE>getFitPolicy()</CODE></A>, 
<A HREF="../../../javax/microedition/lcdui/Choice.html#setFitPolicy(int)"><CODE>setFitPolicy(int)</CODE></A><DT><B>Since: </B><DD>MIDP 2.0</DD>
</DL>
</DD>
</DL>
<HR>

<A NAME="TEXT_WRAP_ON"><!-- --></A><H3>
TEXT_WRAP_ON</H3>
<PRE>
public static final int <B>TEXT_WRAP_ON</B></PRE>
<DL>
<DD>Constant for hinting that text element contents should be wrapped to to multiple lines if necessary to fit available content space.  The Implementation may limit the maximum number of lines that it will actually present. <p>Field has the value <code>1</code>.</p><DD><DL>
<DT><B>See Also: </B><DD><A HREF="../../../javax/microedition/lcdui/Choice.html#getFitPolicy()"><CODE>getFitPolicy()</CODE></A>, 
<A HREF="../../../javax/microedition/lcdui/Choice.html#setFitPolicy(int)"><CODE>setFitPolicy(int)</CODE></A><DT><B>Since: </B><DD>MIDP 2.0</DD>
</DL>
</DD>
</DL>
<HR>

<A NAME="TEXT_WRAP_OFF"><!-- --></A><H3>
TEXT_WRAP_OFF</H3>
<PRE>
public static final int <B>TEXT_WRAP_OFF</B></PRE>
<DL>
<DD>Constant for hinting that text element contents should be limited to a single line.  Line ending is forced, for example by cropping, if there is too much text to fit to the line.  The implementation should provide some means to present the full element contents.  This may be done, for example, by using a special pop-up window or by scrolling the text of the focused element.  <p>Implementations should indicate that cropping has occurred, for example, by placing an ellipsis at the point where the text contents have been cropped.</p> <p>Field has the value <code>2</code>.</p><DD><DL>
<DT><B>See Also: </B><DD><A HREF="../../../javax/microedition/lcdui/Choice.html#getFitPolicy()"><CODE>getFitPolicy()</CODE></A>, 
<A HREF="../../../javax/microedition/lcdui/Choice.html#setFitPolicy(int)"><CODE>setFitPolicy(int)</CODE></A><DT><B>Since: </B><DD>MIDP 2.0</DD>
</DL>
</DD>
</DL>

<!-- ========= CONSTRUCTOR DETAIL ======== -->


<!-- ============ 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 present.<DD><DL>
<DT><B>Returns:</B><DD>the number of elements in the <code>Choice</code></DL>
</DD>
</DL>
<HR>

<A NAME="getString(int)"><!-- --></A><H3>
getString</H3>
<PRE>
public <A HREF="../../../java/lang/String.html">String</A> <B>getString</B>(int&nbsp;elementNum)</PRE>
<DL>
<DD>Gets the <code>String</code> part of the element referenced by <code>elementNum</code>. The <code>elementNum</code> parameter must be within the range <code>[0..size()-1]</code>, inclusive.<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><A HREF="../../../java/lang/IndexOutOfBoundsException.html">IndexOutOfBoundsException</A></CODE> - if <code>elementNum</code> is invalid<DT><B>See Also: </B><DD><A HREF="../../../javax/microedition/lcdui/Choice.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>. The <code>elementNum</code> parameter must be within the range <code>[0..size()-1]</code>, inclusive.<DD><DL>
<DT><B>Parameters:</B><DD><CODE>elementNum</CODE> - the index 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><A HREF="../../../java/lang/IndexOutOfBoundsException.html">IndexOutOfBoundsException</A></CODE> - if <code>elementNum</code> is invalid<DT><B>See Also: </B><DD><A HREF="../../../javax/microedition/lcdui/Choice.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>(<A HREF="../../../java/lang/String.html">String</A>&nbsp;stringPart,                  <A HREF="../../../javax/microedition/lcdui/Image.html">Image</A>&nbsp;imagePart)</PRE>
<DL>
<DD>Appends an element to the <code>Choice</code>. The added element will be the last element of the <code>Choice</code>. The size of the <code>Choice</code> grows by one.<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><A HREF="../../../java/lang/NullPointerException.html">NullPointerException</A></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,                   <A HREF="../../../java/lang/String.html">String</A>&nbsp;stringPart,                   <A HREF="../../../javax/microedition/lcdui/Image.html">Image</A>&nbsp;imagePart)</PRE>
<DL>
<DD>Inserts an element into the <code>Choice</code> just prior to the element specified. The size of the <code>Choice</code> grows by one. The <code>elementNum</code> parameter must be within the range <code>[0..size()]</code>, inclusive.  The index of the last element is <code>size()-1</code>, and so there is actually no element whose index is <code>size()</code>. If this value is used for <code>elementNum</code>, the new element is inserted immediately after the last element. In this case, the effect is identical to <A HREF="../../../javax/microedition/lcdui/Choice.html#append(java.lang.String, javax.microedition.lcdui.Image)"><CODE>append()</CODE></A>.<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><A HREF="../../../java/lang/IndexOutOfBoundsException.html">IndexOutOfBoundsException</A></CODE> - if <code>elementNum</code> is invalid<DD><CODE><A HREF="../../../java/lang/NullPointerException.html">NullPointerException</A></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>. The size of the <code>Choice</code> shrinks by one. It is legal to delete all elements from a <code>Choice</code>. The <code>elementNum</code> parameter must be within the range <code>[0..size()-1]</code>, inclusive.<DD><DL>
<DT><B>Parameters:</B><DD><CODE>elementNum</CODE> - the index of the element to be deleted<DT><B>Throws:</B><DD><CODE><A HREF="../../../java/lang/IndexOutOfBoundsException.html">IndexOutOfBoundsException</A></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>Choice</code>, leaving it with zero elements. This method does nothing if the <code>Choice</code> is already empty.<DD><DL>
<DT><B>Since: </B><DD>MIDP 2.0</DD>
</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,                <A HREF="../../../java/lang/String.html">String</A>&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. The <code>elementNum</code> parameter must be within the range <code>[0..size()-1]</code>, inclusive.  The font attribute of the element is left unchanged.<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><A HREF="../../../java/lang/IndexOutOfBoundsException.html">IndexOutOfBoundsException</A></CODE> - if <code>elementNum</code> is invalid<DD><CODE><A HREF="../../../java/lang/NullPointerException.html">NullPointerException</A></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.

⌨️ 快捷键说明

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