比如JOptionPane.showConfirmDialog(null,"What Option should I make",?);
后面的optionType不知道到那里去找。
后面的optionType不知道到那里去找。
解决方案 »
- 搞定了connection refused问题,还有个【**用户登录失败】问题?无解了,帮忙看看
- 线程程序的问题
- 有一个swing的画图问题问问大家
- JList的BUG吗?今天发现一个奇怪的问题!
- [求助]需要转换txt数据到mysql数据库,没思路,哪位大侠可以指条明路(欢迎砸帖)
- java有转不过来的码吗?new String(ss.getBytes("UTF-8"),"GBK")也没用...
- 面试题 有关于类型转换的 !!!!!!!!有点乱!!!
- 我有这样一个问题,急!!关于类型转换
- linux下的jni问题?
- 各位大虾,推荐一个集成开发环境
- 如何在一个提供多线程功能的Applet上输出1到20的数字?
- 谁有上次JAVA CUP的题目啊?
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()
帮助再那儿找?
我是用的ItelliJIdea,在Java API docs里面没有么?
大家都是看html文件么?