比如JOptionPane.showConfirmDialog(null,"What Option should I make",?);
后面的optionType不知道到那里去找。

解决方案 »

  1.   

    showConfirmDialog
    public static int showConfirmDialog(Component parentComponent,
                                        Object message)
                                 throws HeadlessExceptionBrings up a dialog with the options Yes,
     No and Cancel; with the
     title, Select an Option.Parameters:parentComponent - determines the Frame in which the
    dialog is displayed; if null,
    or if the parentComponent has no
    Frame, a 
                      default Frame is usedmessage - the Object to display
    Returns:an integer indicating the option selected by the user
    Throws:
    HeadlessException - if
       GraphicsEnvironment.isHeadless returns
       trueSee Also:GraphicsEnvironment.isHeadless()
    --------------------------------------------------------------------------------
    showConfirmDialog
    public static int showConfirmDialog(Component parentComponent,
                                        Object message,
                                        String title,
                                        int optionType)
                                 throws HeadlessExceptionBrings up a dialog where the number of choices is determined
     by the optionType parameter.Parameters:parentComponent - determines the Frame in which the
    dialog is displayed; if null,
    or if the parentComponent has no
    Frame, a 
                      default Frame is usedmessage - the Object to displaytitle - the title string for the dialogoptionType - an int designating the options available on the dialog:
                      YES_NO_OPTION, or
    YES_NO_CANCEL_OPTION
    Returns:an int indicating the option selected by the user
    Throws:
    HeadlessException - if
       GraphicsEnvironment.isHeadless returns
       trueSee Also:GraphicsEnvironment.isHeadless()
    --------------------------------------------------------------------------------
    showConfirmDialog
    public static int showConfirmDialog(Component parentComponent,
                                        Object message,
                                        String title,
                                        int optionType,
                                        int messageType)
                                 throws HeadlessExceptionBrings up a dialog where the number of choices is determined
     by the optionType parameter, where the
     messageType
     parameter determines the icon to display.
     The messageType parameter is primarily used to supply
     a default icon from the Look and Feel.Parameters:parentComponent - determines the Frame in
    which the dialog is displayed; if null,
    or if the parentComponent has no
    Frame, a 
                      default Frame is used.message - the Object to displaytitle - the title string for the dialogoptionType - an integer designating the options available
    on the dialog: YES_NO_OPTION,
    or YES_NO_CANCEL_OPTIONmessageType - an integer designating the kind of message this is; 
                      primarily used to determine the icon from the pluggable
                      Look and Feel: ERROR_MESSAGE,
    INFORMATION_MESSAGE, 
                      WARNING_MESSAGE,
                      QUESTION_MESSAGE,
    or PLAIN_MESSAGE
    Returns:an integer indicating the option selected by the user
    Throws:
    HeadlessException - if
       GraphicsEnvironment.isHeadless returns
       trueSee Also:GraphicsEnvironment.isHeadless()
    --------------------------------------------------------------------------------
    showConfirmDialog
    public static int showConfirmDialog(Component parentComponent,
                                        Object message,
                                        String title,
                                        int optionType,
                                        int messageType,
                                        Icon icon)
                                 throws HeadlessExceptionBrings up a dialog with a specified icon, where the number of 
     choices is determined by the optionType parameter.
     The messageType parameter is primarily used to supply
     a default icon from the look and feel.Parameters:parentComponent - determines the Frame in which the
    dialog is displayed; if null,
    or if the parentComponent has no
    Frame, a 
    default Frame is usedmessage - the Object to displaytitle - the title string for the dialogoptionType - an int designating the options available on the dialog:
                      YES_NO_OPTION,
    or YES_NO_CANCEL_OPTIONmessageType - an int designating the kind of message this is, 
                      primarily used to determine the icon from the pluggable
                      Look and Feel: ERROR_MESSAGE,
    INFORMATION_MESSAGE, 
                      WARNING_MESSAGE,
                      QUESTION_MESSAGE,
    or PLAIN_MESSAGEicon - the icon to display in the dialog
    Returns:an int indicating the option selected by the user
    Throws:
    HeadlessException - if
       GraphicsEnvironment.isHeadless returns
       trueSee Also:GraphicsEnvironment.isHeadless()
    --------------------------------------------------------------------------------
    showOptionDialog
    public static int showOptionDialog(Component parentComponent,
                                       Object message,
                                       String title,
                                       int optionType,
                                       int messageType,
                                       Icon icon,
                                       Object[] options,
                                       Object initialValue)
                                throws HeadlessExceptionBrings up a dialog with a specified icon, where the initial
     choice is determined by the initialValue parameter and
     the number of choices is determined by the optionType 
     parameter.
     
     If optionType is YES_NO_OPTION,
     or YES_NO_CANCEL_OPTION
     and the options parameter is null,
     then the options are
     supplied by the look and feel. 
     
     The messageType parameter is primarily used to supply
     a default icon from the look and feel.Parameters:parentComponent - determines the Frame
    in which the dialog is displayed;  if 
                      null, or if the
    parentComponent has no
    Frame, a 
                      default Frame is usedmessage - the Object to displaytitle - the title string for the dialogoptionType - an integer designating the options available on the
    dialog: YES_NO_OPTION,
    or YES_NO_CANCEL_OPTIONmessageType - an integer designating the kind of message this is, 
                      primarily used to determine the icon from the
    pluggable Look and Feel: ERROR_MESSAGE,
    INFORMATION_MESSAGE, 
                      WARNING_MESSAGE,
                      QUESTION_MESSAGE,
    or PLAIN_MESSAGEicon - the icon to display in the dialogoptions - an array of objects indicating the possible choices
                      the user can make; if the objects are components, they
                      are rendered properly; non-String
    objects are
                      rendered using their toString methods;
                      if this parameter is null,
    the options are determined by the Look and FeelinitialValue - the object that represents the default selection
                      for the dialog; only meaningful if options
    is used; can be null
    Returns:an integer indicating the option chosen by the user, 
              or CLOSED_OPTION if the user closed
                      the dialog
    Throws:
    HeadlessException - if
       GraphicsEnvironment.isHeadless returns
       trueSee Also:GraphicsEnvironment.isHeadless()
      

  2.   

    楼上好快。
    帮助再那儿找?
    我是用的ItelliJIdea,在Java API docs里面没有么?
      

  3.   

    就是在Java API docs里的
      

  4.   

    有没有简便的搜索办法和相关联的查找?
    大家都是看html文件么?
      

  5.   

    ItelliJ Idea 里的话查看源文件可以用 Ctrl + 左键 点击相应的方法名。查看帮助可以双击选定方法 ,然后用 Shift + F1 得到帮助。不知道是不是你想要的东西你可以另外去看看 ItelliJ Idea 版块里面的内容啊~~~  (并非广告啊~~)
      

  6.   

    怎么看?还是不知道,再说,Java API docs里也不能输入方法呀?还是不知道怎么用java的帮助文档。