📄 choicegroup.html
字号:
</DD>
</DL>
<HR>
<A NAME="setSelectedIndex(int, boolean)"><!-- --></A><H3>
setSelectedIndex</H3>
<PRE>
public void <B>setSelectedIndex</B>(int elementNum, boolean selected)</PRE>
<DL>
<DD>For <code>ChoiceGroup</code> objects of type <code>MULTIPLE</code>, this simply sets an individual element's selected state. <P>For <code>ChoiceGroup</code> objects of type <code>EXCLUSIVE</code> and <code>POPUP</code>, this can be used only to select an element. That is, the <code> selected </code> parameter must be <code> true </code>. When an element is selected, the previously selected element is deselected. If <code> selected </code> is <code> false </code>, this call is ignored.</P> <p>For both list types, the <code>elementNum</code> parameter must be within the range <code>[0..size()-1]</code>, inclusive. </p><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 number of the element. Indexing of the elements is zero-based<DD><CODE>selected</CODE> - the new state of the element <code>true=selected</code>, <code>false=not</code> selected<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/ChoiceGroup.html#getSelectedIndex()"><CODE>getSelectedIndex()</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="setSelectedFlags(boolean[])"><!-- --></A><H3>
setSelectedFlags</H3>
<PRE>
public void <B>setSelectedFlags</B>(boolean[] selectedArray)</PRE>
<DL>
<DD>Attempts to set the selected state of every element in the <code>ChoiceGroup</code>. The array must be at least as long as the size of the <code>ChoiceGroup</code>. If the array is longer, the additional values are ignored. <p> For <code>ChoiceGroup</code> objects of type <code>MULTIPLE</code>, this sets the selected state of every element in the <code>Choice</code>. An arbitrary number of elements may be selected. <p> For <code>ChoiceGroup</code> objects of type <code>EXCLUSIVE</code> and <code>POPUP</code>, exactly one array element must have the value <code>true</code>. If no element is <code>true</code>, the first element in the <code>Choice</code> will be selected. If two or more elements are <code>true</code>, the implementation will choose the first <code>true</code> element and select it. <p><DD><DL>
<DT><B>Specified by: </B><DD><CODE><A HREF="../../../javax/microedition/lcdui/Choice.html#setSelectedFlags(boolean[])">setSelectedFlags</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</CODE> - an array in which the method collect the selection status<DT><B>Throws:</B><DD><CODE><A HREF="../../../java/lang/IllegalArgumentException.html">IllegalArgumentException</A></CODE> - if <code>selectedArray</code> is shorter than the size of the <code>ChoiceGroup</code><DD><CODE><A HREF="../../../java/lang/NullPointerException.html">NullPointerException</A></CODE> - if the <code>selectedArray</code> is <code>null</code><DT><B>See Also: </B><DD><A HREF="../../../javax/microedition/lcdui/ChoiceGroup.html#getSelectedFlags(boolean[])"><CODE>getSelectedFlags(boolean[])</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="setFitPolicy(int)"><!-- --></A><H3>
setFitPolicy</H3>
<PRE>
public void <B>setFitPolicy</B>(int fitPolicy)</PRE>
<DL>
<DD>Sets the application's preferred policy for fitting <code>Choice</code> element contents to the available screen space. The set policy applies for all elements of the <code>Choice</code> object. Valid values are <A HREF="../../../javax/microedition/lcdui/Choice.html#TEXT_WRAP_DEFAULT"><CODE>Choice.TEXT_WRAP_DEFAULT</CODE></A>, <A HREF="../../../javax/microedition/lcdui/Choice.html#TEXT_WRAP_ON"><CODE>Choice.TEXT_WRAP_ON</CODE></A>, and <A HREF="../../../javax/microedition/lcdui/Choice.html#TEXT_WRAP_OFF"><CODE>Choice.TEXT_WRAP_OFF</CODE></A>. Fit policy is a hint, and the implementation may disregard the application's preferred policy.<DD><DL>
<DT><B>Specified by: </B><DD><CODE><A HREF="../../../javax/microedition/lcdui/Choice.html#setFitPolicy(int)">setFitPolicy</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>fitPolicy</CODE> - preferred content fit policy for choice elements<DT><B>Throws:</B><DD><CODE><A HREF="../../../java/lang/IllegalArgumentException.html">IllegalArgumentException</A></CODE> - if <code>fitPolicy</code> is invalid<DT><B>Since: </B><DD>MIDP 2.0</DD>
<DT><B>See Also: </B><DD><A HREF="../../../javax/microedition/lcdui/ChoiceGroup.html#getFitPolicy()"><CODE>getFitPolicy()</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="getFitPolicy()"><!-- --></A><H3>
getFitPolicy</H3>
<PRE>
public int <B>getFitPolicy</B>()</PRE>
<DL>
<DD>Gets the application's preferred policy for fitting <code>Choice</code> element contents to the available screen space. The value returned is the policy that had been set by the application, even if that value had been disregarded by the implementation.<DD><DL>
<DT><B>Specified by: </B><DD><CODE><A HREF="../../../javax/microedition/lcdui/Choice.html#getFitPolicy()">getFitPolicy</A></CODE> in interface <CODE><A HREF="../../../javax/microedition/lcdui/Choice.html">Choice</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><DD>one of <A HREF="../../../javax/microedition/lcdui/Choice.html#TEXT_WRAP_DEFAULT"><CODE>Choice.TEXT_WRAP_DEFAULT</CODE></A>, <A HREF="../../../javax/microedition/lcdui/Choice.html#TEXT_WRAP_ON"><CODE>Choice.TEXT_WRAP_ON</CODE></A>, or <A HREF="../../../javax/microedition/lcdui/Choice.html#TEXT_WRAP_OFF"><CODE>Choice.TEXT_WRAP_OFF</CODE></A><DT><B>Since: </B><DD>MIDP 2.0</DD>
<DT><B>See Also: </B><DD><A HREF="../../../javax/microedition/lcdui/ChoiceGroup.html#setFitPolicy(int)"><CODE>setFitPolicy(int)</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="setFont(int, javax.microedition.lcdui.Font)"><!-- --></A><H3>
setFont</H3>
<PRE>
public void <B>setFont</B>(int elementNum, <A HREF="../../../javax/microedition/lcdui/Font.html">Font</A> font)</PRE>
<DL>
<DD>Sets the application's preferred font for rendering the specified element of this <code>Choice</code>. An element's font is a hint, and the implementation may disregard the application's preferred font. <p> The <code>elementNum</code> parameter must be within the range <code>[0..size()-1]</code>, inclusive.</p> <p> The <code>font</code> parameter must be a valid <code>Font</code> object or <code>null</code>. If the <code>font</code> parameter is <code>null</code>, the implementation must use its default font to render the element.</p><DD><DL>
<DT><B>Specified by: </B><DD><CODE><A HREF="../../../javax/microedition/lcdui/Choice.html#setFont(int, javax.microedition.lcdui.Font)">setFont</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>font</CODE> - the preferred font to use to render 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>Since: </B><DD>MIDP 2.0</DD>
<DT><B>See Also: </B><DD><A HREF="../../../javax/microedition/lcdui/ChoiceGroup.html#getFont(int)"><CODE>getFont(int)</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="getFont(int)"><!-- --></A><H3>
getFont</H3>
<PRE>
public <A HREF="../../../javax/microedition/lcdui/Font.html">Font</A> <B>getFont</B>(int elementNum)</PRE>
<DL>
<DD>Gets the application's preferred font for rendering the specified element of this <code>Choice</code>. The value returned is the font that had been set by the application, even if that value had been disregarded by the implementation. If no font had been set by the application, or if the application explicitly set the font to <code>null</code>, the value is the default font chosen by the implementation. <p> The <code>elementNum</code> parameter must be within the range <code>[0..size()-1]</code>, inclusive.</p><DD><DL>
<DT><B>Specified by: </B><DD><CODE><A HREF="../../../javax/microedition/lcdui/Choice.html#getFont(int)">getFont</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<DT><B>Returns:</B><DD>the preferred font to use to render 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>Since: </B><DD>MIDP 2.0</DD>
<DT><B>See Also: </B><DD><A HREF="../../../javax/microedition/lcdui/ChoiceGroup.html#setFont(int, javax.microedition.lcdui.Font)"><CODE>setFont(int elementNum, Font font)</CODE></A></DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>
<!-- ========== START OF NAVBAR ========== -->
<A NAME="navbar_bottom"><!-- --></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/ChoiceGroup.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
<strong>MID Profile</strong></EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../javax/microedition/lcdui/Canvas.html"><B>PREV CLASS</B></A>
<A HREF="../../../javax/microedition/lcdui/Command.html"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../index.html" TARGET="_top"><B>FRAMES</B></A>
<A HREF="ChoiceGroup.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY: INNER | <A HREF="#fields_inherited_from_class_javax.microedition.lcdui.Item">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<!-- =========== END OF NAVBAR =========== -->
<HR>
<font size="-1"><a href="mailto:midp-feedback@risc.sps.mot.com">Submit a comment or suggestion</a> Version 2.0 of MID Profile Specification<br>Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries. Copyright (c) 1993-2002 Sun Microsystems, Inc. 901 San Antonio Road,Palo Alto, California, 94303, U.S.A. All Rights Reserved.</font>
</BODY>
</HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -