方
法
|
功
能
|
public Static String showInputDialog (Object message)
|
显示一个有
message
的对话窗口,并将用户在输入域输入的数据按字符串返回。
message
通常为字符串。
|
public static String showInputDialog (Obj-ect message
,
Object
initialSelecti- onValue)
|
显示一个有
message
的对话窗口,并在输入域显示预设值
initialSelectionValue
。将用户在输入域输入的数据或预设值按字符串返回。
message
和
initialSelectionValue
通常为字符串。
|
public static String showInputDialog (Component parentComponent,
Object
message, Object initialSelectionValue)
|
在上一级窗口
parentComponent
中显示一个有
message
的对话窗口,并在输入域显示预设值
initialSelectionValue
。将用户在输入域输入的数据或预设值按字符串返回。
parentComponent
通常为
null
;
message
和
initialSelectionValue
通常为字符串。
|
方
法
|
功
能
|
public static String showInputDialog (Component parentComponent,
Object message,
String title,
int messageType)
|
在上一级窗口
parentComponent
中显示一个有
message
的对话窗口,并显示对话窗口标题
title
,以及消息图标
messageType
。将用户在输入域输入的数据按字符串返回。
parentComponent
通常为
null
;
message
和
initialSelectionValue
通常为字符串;
messageType
的值见表
3.12
。
|
public static void showMessageDialog (Component parentComponent,
Object
message)
|
在上一级窗口
parentComponent
中显示一个有
message
的输出窗口。
parentComponent
通常为
null
;
message
通常为字符串,或者
GUI
组件。
|
public static void showMessageDialog (Component parentComponent,
Object message,
String title,
int messageType)
|
在上一级窗口
parentComponent
中显示一个有
message
的输出窗口,并显示窗口标题
title
,以及消息图标
messageType
。
parentComponent
通常为
null
;
message
通常为字符串,或者
GUI
组件。
messageType
的值见表
3.12
。
|
public static int showConfirmDialog (Component parentComponent,
Object
message)
|
显示一个带有选项按钮
Yes
、
No
和
Cancel
的
message
对话窗口,并返回用户的选项
(
Yes=1
、
No=2,
Cancel=3
)
值。窗口标题为
Select an Option
。
|
消息图标类型
|
整
数
值
|
图
标
|
ERROR_MESSAGE
|
0
|
X
型图标
|
INFORMATION_MESSAGE
|
1
|
倒惊叹号图标
|
WARNING_MESSAGE
|
2
|
惊叹号图标
|
QUESTION_MESSAGE
|
3
|
问号图标
|
PLAIN_MESSAGE
|
-
1
|
不显示任何图标
|