所有类


javax.swing
类 JOptionPane

java.lang.Object
  继承者 java.awt.Component
      继承者 java.awt.Container
          继承者 javax.swing.JComponent
              继承者 javax.swing.JOptionPane
所有已实现的接口:
ImageObserver, MenuContainer, Serializable, Accessible

public class JOptionPane
   
   
   
   
   
extends JComponent
implements Accessible

JOptionPane 有助于方便地弹出要求用户提供值或向其发出通知的标准对话框。有关使用 JOptionPane 的信息,请参见《The Java Tutorial》中的 How to Make Dialogs 一节。

虽然由于方法数多使 JOptionPane 类可能显得复杂,但几乎所有此类的使用都是对下列静态 showXxxDialog 方法之一的单行调用:

方法名描述
showConfirmDialog询问一个确认问题,如 yes/no/cancel。
showInputDialog提示要求某些输入。
showMessageDialog告知用户某事已发生。
showOptionDialog上述三项的大统一 (Grand Unification)。
所有这些方法还可能以 showInternalXXX 风格出现,该风格使用内部窗体来保存对话框(请参见 JInternalFrame)。此外还定义了多种便捷方法,这些方法重载那些基本方法,使用不同的参数列表。

所有对话框都是有模式的。在用户交互完成之前,每个 showXxxDialog 方法都一直阻塞当前线程。

图标消息
输入值
选项按钮
这些对话框的基本外形通常与右图类似,尽管各种外观从根本上决定着最后结果。尤其是,外观可以调整布局以适应选项窗格的 ComponentOrientation 属性。

参数:
这些方法的参数遵守一致的模式:

parentComponent
定义作为此对话框的父对话框的 Component。通过两种方式使用此参数:包含它的 Frame 可以用作对话框的父 Frame,在对话框的位置使用其屏幕坐标。一般情况下,将对话框紧靠组件置于其之下。此参数可以为 null,在这种情况下,默认的 Frame 用作父级,并且对话框将居中位于屏幕上(取决于 L&F)。
message
要置于对话框中的描述消息。在最常见的应用中,message 就是一个 StringString 常量。不过,此参数的类型实际上是 Object。其解释依赖于其类型:
Object[]
对象数组被解释为在纵向堆栈中排列的一系列 message(每个对象一个)。解释是递归式的,即根据其类型解释数组中的每个对象。
Component
Component 在对话框中显示。
Icon
Icon 被包装在 JLabel 中并在对话框中显示。
其他
该对象通过调用其 toString 方法被转换为 String。结果被包装在 JLabel 中显示。
messageType
定义 message 的样式。外观管理器布置的对话框可能因此值而异,并且往往提供默认图标。可能的值为:
  • ERROR_MESSAGE
  • INFORMATION_MESSAGE
  • WARNING_MESSAGE
  • QUESTION_MESSAGE
  • PLAIN_MESSAGE
optionType
定义在对话框的底部显示的选项按钮的集合:
  • DEFAULT_OPTION
  • YES_NO_OPTION
  • YES_NO_CANCEL_OPTION
  • OK_CANCEL_OPTION
用户并非仅限于使用选项按钮的此集合。使用 options 参数可以提供想使用的任何按钮。
options
对将在对话框底部显示的选项按钮集合的更详细描述。options 参数的常规值是 String 数组,但是参数类型是 Object 数组。根据对象的以下类型为每个对象创建一个按钮:
Component
该组件被直接添加到按钮行中。
Icon
创建的 JButton 以此图标作为其标签。
其他
Object 通过使用其 toString 方法转换为字符串,并使用该结果作为 JButton 的标签。
icon
要置于对话框中的装饰性图标。图标的默认值由 messageType 参数确定。
title
对话框的标题。
initialValue
默认选择(输入值)。

当选择更改时,调用生成 PropertyChangeEventsetValue 方法。

如果已为所有输入 setWantsInput 配置了 JOptionPane,则还可以侦听 bound 属性 JOptionPane.INPUT_VALUE_PROPERTY,以确定何时用户输入或选择了值。

当其中一个 showXxxDialog 方法返回整数时,可能的值为:

  • YES_OPTION
  • NO_OPTION
  • CANCEL_OPTION
  • OK_OPTION
  • CLOSED_OPTION
示例:
显示一个错误对话框,该对话框显示的 message 为 'alert':
JOptionPane.showMessageDialog(null, "alert", "alert", JOptionPane.ERROR_MESSAGE);

显示一个内部信息对话框,其 message 为 'information':
JOptionPane.showInternalMessageDialog(frame, "information",
      "information", JOptionPane.INFORMATION_MESSAGE);

显示一个信息面板,其 options 为 "yes/no",message 为 'choose one':
JOptionPane.showConfirmDialog(null,
      "choose one", "choose one", JOptionPane.YES_NO_OPTION);

显示一个内部信息对话框,其 options 为 "yes/no/cancel",message 为 'please choose one',并具有 title 信息:
JOptionPane.showInternalConfirmDialog(frame,
      "please choose one", "information",
      JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.INFORMATION_MESSAGE);

显示一个警告对话框,其 options 为 OK、CANCEL,title 为 'Warning',message 为 'Click OK to continue':
Object[] options = { "OK", "CANCEL" };
JOptionPane.showOptionDialog(null, "Click OK to continue", "Warning",
      JOptionPane.DEFAULT_OPTION, JOptionPane.WARNING_MESSAGE,
      null, options, options[0]);

显示一个要求用户键入 String 的对话框:
String inputValue = JOptionPane.showInputDialog("Please input a value");

显示一个要求用户选择 String 的对话框:
Object[] possibleValues = { "First", "Second", "Third" };
Object selectedValue = JOptionPane.showInputDialog(null,
      "Choose one", "Input",
      JOptionPane.INFORMATION_MESSAGE, null,
      possibleValues, possibleValues[0]);

直接使用:
要直接创建和使用 JOptionPane,标准模式大致如下:
     JOptionPane pane = new JOptionPane(arguments);
     pane.set.Xxxx(...); // Configure
     JDialog dialog = pane.createDialog(parentComponent, title);
     dialog.show();
     Object selectedValue = pane.getValue();
     if(selectedValue == null)
       return CLOSED_OPTION;
     //If there is not an array of option buttons:
     if(options == null) {
       if(selectedValue instanceof Integer)
          return ((Integer)selectedValue).intValue();
       return CLOSED_OPTION;
     }
     //If there is an array of option buttons:
     for(int counter = 0, maxCounter = options.length;
        counter < maxCounter; counter++) {
        if(options[counter].equals(selectedValue))
        return counter;
     }
     return CLOSED_OPTION;
 

警告:此类的序列化对象将与以后的 Swing 版本不兼容。当前的序列化支持适用于短期存储或运行相同 Swing 版本的应用程序之间的 RMI。从 1.4 版本开始,已在 java.beans 包中添加了支持所有 JavaBeansTM 长期存储的功能。请参见 XMLEncoder

另请参见:
JInternalFrame

嵌套类摘要
protected  classJOptionPane.AccessibleJOptionPane
          此类实现对 JOptionPane 类的可访问性支持。
 
从类 javax.swing.JComponent 继承的嵌套类/接口
JComponent.AccessibleJComponent
 
从类 java.awt.Container 继承的嵌套类/接口
Container.AccessibleAWTContainer
 
从类 java.awt.Component 继承的嵌套类/接口
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
字段摘要
static intCANCEL_OPTION
          选择 CANCEL 时从类方法返回的值。
static intCLOSED_OPTION
          用户没有做出任何选择而关闭了窗口时从类方法返回的值,很可能将此值视为 CANCEL_OPTIONNO_OPTION
static intDEFAULT_OPTION
          用于 showConfirmDialog 的类型。
static intERROR_MESSAGE
          用于错误消息。
protected  Iconicon
          在窗格中使用的图标。
static StringICON_PROPERTY
          icon 的 bound 属性名。
static intINFORMATION_MESSAGE
          用于信息消息。
static StringINITIAL_SELECTION_VALUE_PROPERTY
          initialSelectionValue 的 bound 属性名。
static StringINITIAL_VALUE_PROPERTY
          initialValue 的 bound 属性名。
protected  ObjectinitialSelectionValue
          要在 selectionValues 中选择的初始值。
protected  ObjectinitialValue
          应该在 options 中最初选择的值。
static StringINPUT_VALUE_PROPERTY
          inputValue 的 bound 属性名。
protected  ObjectinputValue
          用户已输入的值。
protected  Objectmessage
          要显示的消息。
static StringMESSAGE_PROPERTY
          message 的 bound 属性名。
static StringMESSAGE_TYPE_PROPERTY
          type 的 bound 属性名。
protected  intmessageType
          消息类型。
static intNO_OPTION
          选择 NO 时从类方法返回的值。
static intOK_CANCEL_OPTION
          用于 showConfirmDialog 的类型。
static intOK_OPTION
          选择 OK 时从类方法返回的值。
static StringOPTION_TYPE_PROPERTY
          optionType 的 bound 属性名。
protected  Object[]options
          要向用户显示的选项。
static StringOPTIONS_PROPERTY
          option 的 bound 属性名。
protected  intoptionType
          选项类型,DEFAULT_OPTIONYES_NO_OPTIONYES_NO_CANCEL_OPTIONOK_CANCEL_OPTION 之一。
static intPLAIN_MESSAGE
          未使用图标。
static intQUESTION_MESSAGE
          用于问题。
static StringSELECTION_VALUES_PROPERTY
          selectionValues 的 bound 属性名。
protected  Object[]selectionValues
          用户可以从中选择值的数组。
static ObjectUNINITIALIZED_VALUE
          指示用户尚未选择值。
protected  Objectvalue
          当前选择的值,该值将为有效选项或者 UNINITIALIZED_VALUEnull
static StringVALUE_PROPERTY
          value 的 bound 属性名。
static StringWANTS_INPUT_PROPERTY
          wantsInput 的 bound 属性名。
protected  booleanwantsInput
          如果为 true,则向用户提供 UI 窗口小部件以获取输入。
static intWARNING_MESSAGE
          用于警告消息。
static intYES_NO_CANCEL_OPTION
          用于 showConfirmDialog 的类型。
static intYES_NO_OPTION
          用于 showConfirmDialog 的类型。
static intYES_OPTION
          选择 YES 时从类方法返回的值。
 
从类 javax.swing.JComponent 继承的字段
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
从类 java.awt.Component 继承的字段
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
从接口 java.awt.image.ImageObserver 继承的字段
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
构造方法摘要
JOptionPane()
          创建一个带有测试消息的 JOptionPane
JOptionPane(Object message)
          创建一个显示消息的 JOptionPane 的实例,使其使用 UI 提供的普通消息消息类型和默认选项。
JOptionPane(Object message, int messageType)
          创建一个显示消息的 JOptionPane 的实例,使其具有指定的消息类型和默认选项。
JOptionPane(Object message, int messageType, int optionType)
          创建一个显示消息的 JOptionPane 的实例,使其具有指定的消息类型和选项。
JOptionPane(Object message, int messageType, int optionType, Icon icon)
          创建一个显示消息的 JOptionPane 的实例,使其具有指定的消息类型、选项和图标。
JOptionPane(Object message, int messageType, int optionType, Icon icon, Object[] options)
          创建一个显示消息的 JOptionPane 的实例,使其具有指定的消息类型、图标和选项。
JOptionPane(Object message, int messageType, int optionType, Icon icon, Object[] options, Object initialValue)
          在指定最初选择的选项的前提下,创建一个显示消息的 JOptionPane 的实例,使其具有指定的消息类型、图标和选项。
 
方法摘要
 JDialogcreateDialog(Component parentComponent, String title)
          创建并在 parentComponent 窗体中的 parentComponent 中央返回一个包装 this 的新 JDialog
 JInternalFramecreateInternalFrame(Component parentComponent, String title)
          创建并返回 JInternalFrame 的实例。
 AccessibleContextgetAccessibleContext()
          返回与此 JOptionPane 相关联的 AccessibleContext
static JDesktopPanegetDesktopPaneForComponent(Component parentComponent)
          返回指定组件的桌面窗格。
static FramegetFrameForComponent(Component parentComponent)
          返回指定组件的 Frame
 IcongetIcon()
          返回此窗格显示的图标。
 ObjectgetInitialSelectionValue()
          返回(根据最初选择)向用户显示的输入值。
 ObjectgetInitialValue()
          返回初始值。
 ObjectgetInputValue()
          如果 wantsInput 为 true,则返回用户已输入的值。
 intgetMaxCharactersPerLineCount()
          返回要置于消息的行中的最大字符数。
 ObjectgetMessage()
          返回此窗格显示的消息对象。
 intgetMessageType()
          返回消息类型。
 Object[]getOptions()
          返回用户可以作出的选择。
 intgetOptionType()
          返回显示的选项类型。
static FramegetRootFrame()
          返回用于不提供窗体的类方法中的 Frame
 Object[]getSelectionValues()
          返回输入选择值。
 OptionPaneUIgetUI()
          返回实现此组件 L&F 的 UI 对象。
 StringgetUIClassID()
          返回实现此组件 L&F 的 UI 类的名称。
 ObjectgetValue()
          返回用户所选值。
 booleangetWantsInput()
          返回 wantsInput 属性的值。
protected  StringparamString()
          返回此 JOptionPane 的字符串表示形式。
 voidselectInitialValue()
          请求选择初始值,该请求将焦点设置为初始值。
 voidsetIcon(Icon newIcon)
          设置要显示的图标。
 voidsetInitialSelectionValue(Object newValue)
          设置(根据选择)最初向用户显示的输入值。
 voidsetInitialValue(Object newInitialValue)
          设置要启用的初始值,即最初显示窗格时处于焦点状态的 Component
 voidsetInputValue(Object newValue)
          设置由用户选择或输入的输入值。
 voidsetMessage(Object newMessage)
          设置选项窗格的消息对象。
 voidsetMessageType(int newType)
          设置选项窗格的消息类型。
 voidsetOptions(Object[] newOptions)
          设置此窗格显示的选项。
 voidsetOptionType(int newType)
          设置要显示的选项。
static voidsetRootFrame(Frame newRootFrame)
          设置窗体,以用于不提供窗体的类方法。
 voidsetSelectionValues(Object[] newValues)
          设置窗格的输入选择值,该窗格向用户提供可以从中进行选择的项列表。
 voidsetUI(OptionPaneUI ui)
          设置实现此组件 L&F 的 UI 对象。
 voidsetValue(Object newValue)
          设置用户所选值。
 voidsetWantsInput(boolean newValue)
          设置 wantsInput 属性。
static intshowConfirmDialog(Component parentComponent, Object message)
          调出带有选项 YesNoCancel 的对话框;标题为 Select an Option
static intshowConfirmDialog(Component parentComponent, Object message, String title, int optionType)
          调出一个由 optionType 参数确定其中选项数的对话框。
static intshowConfirmDialog(Component parentComponent, Object message, String title, int optionType, int messageType)
          调用一个由 optionType 参数确定其中选项数的对话框,messageType 参数确定要显示的图标。
static intshowConfirmDialog(Component parentComponent, Object message, String title, int optionType, int messageType, Icon icon)
          调出一个带有指定图标的对话框,其中的选项数由 optionType 参数确定。
static StringshowInputDialog(Component parentComponent, Object message)
          显示请求用户输入内容的问题消息对话框,它以 parentComponent 为父级。
static StringshowInputDialog(Component parentComponent, Object message, Object initialSelectionValue)
          显示请求用户输入内容的问题消息对话框,它以 parentComponent 为父级。
static StringshowInputDialog(Component parentComponent, Object message, String title, int messageType)
          显示请求用户提供输入的对话框,它以 parentComponent 为父级,该对话框的标题为 title,消息类型为 messageType
static ObjectshowInputDialog(Component parentComponent, Object message, String title, int messageType, Icon icon, Object[] selectionValues, Object initialSelectionValue)
          提示用户在可以指定初始选择、可能选择及其他所有选项的模块化的对话框中输入内容。
static StringshowInputDialog(Object message)
          显示请求用户输入的问题消息对话框。
static StringshowInputDialog(Object message, Object initialSelectionValue)
          显示请求用户输入的问题消息对话框,它带有已初始化为 initialSelectionValue 的输入值。
static intshowInternalConfirmDialog(Component parentComponent, Object message)
          调出带有选项 YesNoCancel 的内部对话框面板;标题为 Select an Option
static intshowInternalConfirmDialog(Component parentComponent, Object message, String title, int optionType)
          调出一个由 optionType 参数确定其中选项数的内部对话框面板。
static intshowInternalConfirmDialog(Component parentComponent, Object message, String title, int optionType, int messageType)
          调出一个由 optionType 参数确定其中选项数的内部对话框面板,messageType 参数确定要显示的图标。
static intshowInternalConfirmDialog(Component parentComponent, Object message, String title, int optionType, int messageType, Icon icon)
          调出一个带有指定图标的内部对话框面板,其中的选项数由 optionType 参数确定。
static StringshowInternalInputDialog(Component parentComponent, Object message)
          显示请求用户输入内容的内部问题消息对话框,它以 parentComponent 为父级。
static StringshowInternalInputDialog(Component parentComponent, Object message, String title, int messageType)
          显示请求用户提供输入的内部对话框,该对话框的标题为 title,消息类型为 messageType,并以 parentComponent 为父级。
static ObjectshowInternalInputDialog(Component parentComponent, Object message, String title, int messageType, Icon icon, Object[] selectionValues, Object initialSelectionValue)
          提示用户在可以指定初始选择、可能选择及其他所有选项的模块化的内部对话框中输入内容。
static voidshowInternalMessageDialog(Component parentComponent, Object message)
          调出内部确认对话框面板。
static voidshowInternalMessageDialog(Component parentComponent, Object message, String title, int messageType)
          调出一个显示消息的内部对话框面板,它使用由 messageType 参数确定的默认图标。
static voidshowInternalMessageDialog(Component parentComponent, Object message, String title, int messageType, Icon icon)
          调出一个显示消息的内部对话框面板,为其指定了所有参数。
static intshowInternalOptionDialog(Component parentComponent, Object message, String title, int optionType, int messageType, Icon icon, Object[] options, Object initialValue)
          调出一个带有指定图标的内部对话框面板,其中的初始选择由 initialValue 参数确定,选项数由 optionType 参数确定。
static voidshowMessageDialog(Component parentComponent, Object message)
          调出标题为 "Message" 的信息消息对话框。
static voidshowMessageDialog(Component parentComponent, Object message, String title, int messageType)
          调出对话框,它显示使用由 messageType 参数确定的默认图标的 message。
static voidshowMessageDialog(Component parentComponent, Object message, String title, int messageType, Icon icon)
          调出一个显示信息的对话框,为其指定了所有参数。
static intshowOptionDialog(Component parentComponent, Object message, String title, int optionType, int messageType, Icon icon, Object[] options, Object initialValue)
          调出一个带有指定图标的对话框,其中的初始选择由 initialValue 参数确定,选项数由 optionType 参数确定。
 voidupdateUI()
          UIManager 发出的关于 L&F 已改变的通知。
 
从类 javax.swing.JComponent 继承的方法
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
从类 java.awt.Container 继承的方法
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
从类 java.awt.Component 继承的方法
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

字段详细信息

UNINITIALIZED_VALUE

public static final Object UNINITIALIZED_VALUE
指示用户尚未选择值。


DEFAULT_OPTION

public static final int DEFAULT_OPTION
用于 showConfirmDialog 的类型。

另请参见:
常量字段值

YES_NO_OPTION

public static final int YES_NO_OPTION
用于 showConfirmDialog 的类型。

另请参见:
常量字段值

YES_NO_CANCEL_OPTION

public static final int YES_NO_CANCEL_OPTION
用于 showConfirmDialog 的类型。

另请参见:
常量字段值

OK_CANCEL_OPTION

public static final int OK_CANCEL_OPTION
用于 showConfirmDialog 的类型。

另请参见:
常量字段值

YES_OPTION

public static final int YES_OPTION
选择 YES 时从类方法返回的值。

另请参见:
常量字段值

NO_OPTION

public static final int NO_OPTION
选择 NO 时从类方法返回的值。

另请参见:
常量字段值