choicecallback.html

来自「SUN公司官方J2EE中文帮助文档 应该不错 有兴趣的下来看看 html格式的」· HTML 代码 · 共 405 行 · 第 1/2 页

HTML
405
字号
public <B>ChoiceCallback</B>(java.lang.String&nbsp;prompt,
                      java.lang.String[]&nbsp;choices,
                      int&nbsp;defaultChoice,
                      boolean&nbsp;multipleSelectionsAllowed)</PRE>
<DL>
<DD>Construct a <code>ChoiceCallback</code> with a prompt,
 a list of choices, a default choice, and a boolean specifying
 whether or not multiple selections from the list of choices are allowed.

 <p><DD><DL>
<DT><B>Parameters:</B><DD><CODE>prompt</CODE> - the prompt used to describe the list of choices. <p><DD><CODE>choices</CODE> - the list of choices. <p><DD><CODE>defaultChoice</CODE> - the choice to be used as the default choice
			when the list of choices are displayed.  This value
			is represented as an index into the
			<code>choices</code> array. <p><DD><CODE>multipleSelectionsAllowed</CODE> - boolean specifying whether or
			not multiple selections can be made from the
			list of choices.<DT><B>Throws:</B><DD><CODE>java.lang.IllegalArgumentException</CODE> - if <code>prompt</code> is null,
			if <code>prompt</code> has a length of 0,
			if <code>choices</code> is null,
			if <code>choices</code> has a length of 0,
			if any element from <code>choices</code> is null,
			if any element from <code>choices</code>
			has a length of 0 or if <code>defaultChoice</code>
			does not fall within the array boundaries of
			<code>choices</code>.</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="getPrompt()"><!-- --></A><H3>
getPrompt</H3>
<PRE>
public java.lang.String <B>getPrompt</B>()</PRE>
<DL>
<DD>Get the prompt.

 <p><DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><DD>the prompt.</DL>
</DD>
</DL>
<HR>

<A NAME="getChoices()"><!-- --></A><H3>
getChoices</H3>
<PRE>
public java.lang.String[] <B>getChoices</B>()</PRE>
<DL>
<DD>Get the list of choices.

 <p><DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><DD>the list of choices.</DL>
</DD>
</DL>
<HR>

<A NAME="getDefaultChoice()"><!-- --></A><H3>
getDefaultChoice</H3>
<PRE>
public int <B>getDefaultChoice</B>()</PRE>
<DL>
<DD>Get the defaultChoice.

 <p><DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><DD>the defaultChoice, represented as an index into
		the <code>choices</code> list.</DL>
</DD>
</DL>
<HR>

<A NAME="allowMultipleSelections()"><!-- --></A><H3>
allowMultipleSelections</H3>
<PRE>
public boolean <B>allowMultipleSelections</B>()</PRE>
<DL>
<DD>Get the boolean determining whether multiple selections from
 the <code>choices</code> list are allowed.

 <p><DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><DD>whether multiple selections are allowed.</DL>
</DD>
</DL>
<HR>

<A NAME="setSelectedIndex(int)"><!-- --></A><H3>
setSelectedIndex</H3>
<PRE>
public void <B>setSelectedIndex</B>(int&nbsp;selection)</PRE>
<DL>
<DD>Set the selected choice.

 <p><DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>selection</CODE> - the selection represented as an index into the
		<code>choices</code> list.</DL>
</DD>
</DL>
<HR>

<A NAME="setSelectedIndexes(int[])"><!-- --></A><H3>
setSelectedIndexes</H3>
<PRE>
public void <B>setSelectedIndexes</B>(int[]&nbsp;selections)</PRE>
<DL>
<DD>Set the selected choices.

 <p><DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>selections</CODE> - the selections represented as indexes into the
		<code>choices</code> list.<DT><B>Throws:</B><DD><CODE>UnsupportedOperationException</CODE> - if multiple selections are
		not allowed, as determined by
		<code>allowMultipleSelections</code>.</DL>
</DD>
</DL>
<HR>

<A NAME="getSelectedIndexes()"><!-- --></A><H3>
getSelectedIndexes</H3>
<PRE>
public int[] <B>getSelectedIndexes</B>()</PRE>
<DL>
<DD>Get the selected choices.

 <p><DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><DD>the selected choices, represented as indexes into the
		<code>choices</code> list.</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>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;PREV CLASS&nbsp;
&nbsp;<A HREF="../../../../javax/security/auth/callback/ConfirmationCallback.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>  &nbsp;
&nbsp;<A HREF="ChoiceCallback.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  SUMMARY: &nbsp;INNER&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: &nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<!-- =========== END OF NAVBAR =========== -->

<HR>

</BODY>
</HTML>

⌨️ 快捷键说明

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