JOptionPane这个类里面都有!输入输出对话框!
解决方案 »
- 怎样确定复选框是否被选中
- MyEclipse 6 +Web logic 10 +Struts 1.3 出现java.lang.ClassNotFoundException
- 简单问题
- 请教两个问题
- 怎么用Java+html实现这样的报表
- 关于include的一个问题
- 网站最近出现的奇怪问题!服务器还是数据库问题?菜鸟求救
- 装了JB9,新建文件后,web中怎么只有applet这一项可用,其它项都不能用是怎么回事?
- jsp和jbuilder7.0使用高手请进 200分派送!
- webservice配置文件后无法启动tomcat,会报空指针异常,将配置文件注释后就正常了
- 求助:HTTP Status 500 ,type Exception report在线等。。。
- mysql+jsp中的sql问题!!急急
{
public static void main(String args[])
{
JOptionPane.showMessageDialog(
null,"你好!!");
System.exit(0);
}}
Examples:
Show an error dialog that displays the message, 'alert':
JOptionPane.showMessageDialog(null, "alert", "alert", JOptionPane.ERROR_MESSAGE); Show an internal information dialog with the message, 'information':
JOptionPane.showInternalMessageDialog(frame, "information","information", JOptionPane.INFORMATION_MESSAGE);Show an information panel with the options yes/no and message 'choose one':
JOptionPane.showConfirmDialog(null,
"choose one", "choose one", JOptionPane.YES_NO_OPTION);Show an internal information dialog with the options yes/no/cancel and message 'please choose one' and title information:
JOptionPane.showInternalConfirmDialog(frame,
"please choose one", "information",
JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.INFORMATION_MESSAGE);Show a warning dialog with the options OK, CANCEL, title 'Warning', and 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]);Show a dialog asking the user to type in a String:
String inputValue = JOptionPane.showInputDialog("Please input a value"); Show a dialog asking the user to select a String:
Object[] possibleValues = { "First", "Second", "Third" };
Object selectedValue = JOptionPane.showInputDialog(null,
"Choose one", "Input",
JOptionPane.INFORMATION_MESSAGE, null,
possibleValues, possibleValues[0]);
有没有代码例子?