java命名空间javax.swing类joptionpane的类成员方法:
showinternaloptiondialog定义及介绍
本文导语:
showinternaloptiondialog
public static int showinternaloptiondialog(component parentcomponent,
object message,
string title,
int optiontype,
...
showinternaloptiondialog
public static int showinternaloptiondialog(component parentcomponent,
object message,
string title,
int optiontype,
int messagetype,
icon icon,
object[] options,
object initialvalue)
- 调出一个带有指定图标的内部对话框面板,其中的初始选择由
initialvalue 参数确定,选项数由 optiontype 参数确定。
如果 optiontype 为 yes_no_option,或者 yes_no_cancel_option 且 options 参数为 null,则由外观提供选项。
messagetype 参数主要用于提供来自外观的默认图标。
- 参数:
parentcomponent - 确定在其中显示对话框的 frame;如果为 null 或者 parentcomponent 不具有 frame,则使用默认的 framemessage - 要在对话框中显示的对象;component 对象呈现为 component;string 对象呈现为字符串。其他对象通过 tostring 方法被转换为 stringtitle - 对话框的标题字符串optiontype - 指定可用于对话框的选项的整数:yes_no_option 或 yes_no_cancel_optionmessagetype - 指定消息种类的整数;主要用于确定来自可插入外观的图标:error_message、information_message、warning_message、question_message 或 plain_messageicon - 在对话框中显示的图标options - 指示用户可能选择的对象组成的数组;如果对象是组件,则可以正确呈现;非 string 对象使用其 tostring 方法呈现;如果此参数为 null,则由外观确定选项initialvalue - 表示对话框的默认选择的对象;只有在使用 options 时才有意义;可以为 null
- 返回:
- 指示用户所选选项的整数;如果用户关闭了对话框,则返回
closed_option