📄 joptionpane.html
字号:
with the specified message type, icon, and options.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><B><A HREF="../../javax/swing/JOptionPane.html#JOptionPane(java.lang.Object, int, int, javax.swing.Icon, java.lang.Object[], java.lang.Object)">JOptionPane</A></B>(<A HREF="../../java/lang/Object.html">Object</A> message, int messageType, int optionType, <A HREF="../../javax/swing/Icon.html">Icon</A> icon, <A HREF="../../java/lang/Object.html">Object</A>[] options, <A HREF="../../java/lang/Object.html">Object</A> initialValue)</CODE><BR> Creates an instance of <code>JOptionPane</code> to display a message with the specified message type, icon, and options, with the initially-selected option specified.</TD></TR></TABLE> <!-- ========== METHOD SUMMARY =========== --><A NAME="method_summary"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=2><FONT SIZE="+2"><B>Method Summary</B></FONT></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../javax/swing/JDialog.html">JDialog</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/swing/JOptionPane.html#createDialog(java.awt.Component, java.lang.String)">createDialog</A></B>(<A HREF="../../java/awt/Component.html">Component</A> parentComponent, <A HREF="../../java/lang/String.html">String</A> title)</CODE><BR> Creates and returns a new <code>JDialog</code> wrapping <code>this</code> centered on the <code>parentComponent</code> in the <code>parentComponent</code>'s frame.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../javax/swing/JInternalFrame.html">JInternalFrame</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/swing/JOptionPane.html#createInternalFrame(java.awt.Component, java.lang.String)">createInternalFrame</A></B>(<A HREF="../../java/awt/Component.html">Component</A> parentComponent, <A HREF="../../java/lang/String.html">String</A> title)</CODE><BR> Creates and returns an instance of <code>JInternalFrame</code>.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../javax/accessibility/AccessibleContext.html">AccessibleContext</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/swing/JOptionPane.html#getAccessibleContext()">getAccessibleContext</A></B>()</CODE><BR> Gets the AccessibleContext associated with this JOptionPane.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static <A HREF="../../javax/swing/JDesktopPane.html">JDesktopPane</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/swing/JOptionPane.html#getDesktopPaneForComponent(java.awt.Component)">getDesktopPaneForComponent</A></B>(<A HREF="../../java/awt/Component.html">Component</A> parentComponent)</CODE><BR> Returns the specified component's desktop pane.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static <A HREF="../../java/awt/Frame.html">Frame</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/swing/JOptionPane.html#getFrameForComponent(java.awt.Component)">getFrameForComponent</A></B>(<A HREF="../../java/awt/Component.html">Component</A> parentComponent)</CODE><BR> Returns the specified component's <code>Frame</code>.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../javax/swing/Icon.html">Icon</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/swing/JOptionPane.html#getIcon()">getIcon</A></B>()</CODE><BR> Returns the icon this pane displays.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../java/lang/Object.html">Object</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/swing/JOptionPane.html#getInitialSelectionValue()">getInitialSelectionValue</A></B>()</CODE><BR> Returns the initial-selection value.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../java/lang/Object.html">Object</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/swing/JOptionPane.html#getInitialValue()">getInitialValue</A></B>()</CODE><BR> Returns the initial value.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../java/lang/Object.html">Object</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/swing/JOptionPane.html#getInputValue()">getInputValue</A></B>()</CODE><BR> Returns the value the user has input, if <code>wantsInput</code> is true.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> int</CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/swing/JOptionPane.html#getMaxCharactersPerLineCount()">getMaxCharactersPerLineCount</A></B>()</CODE><BR> Returns the maximum number of characters to place on a line in a message.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../java/lang/Object.html">Object</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/swing/JOptionPane.html#getMessage()">getMessage</A></B>()</CODE><BR> Returns the message-object this pane displays.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> int</CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/swing/JOptionPane.html#getMessageType()">getMessageType</A></B>()</CODE><BR> Returns the message type.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../java/lang/Object.html">Object</A>[]</CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/swing/JOptionPane.html#getOptions()">getOptions</A></B>()</CODE><BR> Returns the choices the user can make.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> int</CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/swing/JOptionPane.html#getOptionType()">getOptionType</A></B>()</CODE><BR> Returns the type of options that are displayed.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static <A HREF="../../java/awt/Frame.html">Frame</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/swing/JOptionPane.html#getRootFrame()">getRootFrame</A></B>()</CODE><BR> Returns the <code>Frame</code> to use for the class methods in which a frame is not provided.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../java/lang/Object.html">Object</A>[]</CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/swing/JOptionPane.html#getSelectionValues()">getSelectionValues</A></B>()</CODE><BR> Returns the selection values.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../javax/swing/plaf/OptionPaneUI.html">OptionPaneUI</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/swing/JOptionPane.html#getUI()">getUI</A></B>()</CODE><BR> Returns the UI object which implements the L&F for this component.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../java/lang/String.html">String</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/swing/JOptionPane.html#getUIClassID()">getUIClassID</A></B>()</CODE><BR> Returns the name of the UI class that implements the L&F for this component.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../java/lang/Object.html">Object</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/swing/JOptionPane.html#getValue()">getValue</A></B>()</CODE><BR> Returns the value the user has selected.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/swing/JOptionPane.html#getWantsInput()">getWantsInput</A></B>()</CODE><BR> Returns true if a <code>parentComponent</code> will be provided for the user to input.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>protected <A HREF="../../java/lang/String.html">String</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/swing/JOptionPane.html#paramString()">paramString</A></B>()</CODE><BR> Returns a string representation of this <code>JOptionPane</code>.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/swing/JOptionPane.html#selectInitialValue()">selectInitialValue</A></B>()</CODE><BR> Requests that the initial value be selected, which will set focus to the initial value.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/swing/JOptionPane.html#setIcon(javax.swing.Icon)">setIcon</A></B>(<A HREF="../../javax/swing/Icon.html">Icon</A> newIcon)</CODE><BR> Sets the icon to display.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/swing/JOptionPane.html#setInitialSelectionValue(java.lang.Object)">setInitialSelectionValue</A></B>(<A HREF="../../java/lang/Object.html">Object</A> newValue)</CODE><BR> Sets the initial selection value.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/swing/JOptionPane.html#setInitialValue(java.lang.Object)">setInitialValue</A></B>(<A HREF="../../java/lang/Object.html">Object</A> newInitialValue)</CODE><BR> Sets the initial value that is to be enabled -- the <code>Component</code> that has the focus when the pane is initially displayed.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/swing/JOptionPane.html#setInputValue(java.lang.Object)">setInputValue</A></B>(<A HREF="../../java/lang/Object.html">Object</A> newValue)</CODE><BR> Sets the user's input-value.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/swing/JOptionPane.html#setMessage(java.lang.Object)">setMessage</A></B>(<A HREF="../../java/lang/Object.html">Object</A> newMessage)</CODE>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -