《java joptionpane.showmessagedialog对话框》由会员分享,可在线阅读,更多相关《java joptionpane.showmessagedialog对话框(3页珍藏版)》请在金锄头文库上搜索。
1、JOptionPane.showMessageDialog(null, 错误消息!, 错误,JOptionPane.ERROR_MESSAGE);JOptionPane.showMessageDialog(null, 信息消息。,“提示, JOptionPane.INFORMATION_MESSAGE);JOptionPane.showMessageDialog(null, 警告对话框!, 警告, JOptionPane.WARNING_MESSAGE);JOptionPane.showMessageDialog(null, 没有图标的提示!, 信息,JOptionPane.PLAIN_MES
2、SAGE);Icon icon = new ImageIcon(getClass().getResource(middle.gif);JOptionPane.showMessageDialog(null, 自定义图片的信息提示!, 信息,JOptionPane.INFORMATION_MESSAGE, icon);Object options = 是的, 不是, 不确定 ; int n = JOptionPane.showOptionDialog(this, 你喜欢看定影吗?, 自定义询问,JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.QUESTI
3、ON_MESSAGE,null, options, options2);Icon icon = new ImageIcon(getClass().getResource(middle.gif);Object options = 是的, 不是, 不确定 ;int n = JOptionPane.showOptionDialog(this, 你喜欢看定影吗?, 自定义询问,JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE,icon, options, options2);int n = JOptionPane.showCo
4、nfirmDialog(this, 你喜欢蓝色吗?, 询问,JOptionPane.YES_NO_OPTION);Object options = Yes, please, No way! ;int n = JOptionPane.showOptionDialog(this,Would you like green eggs and ham?, A Silly Question,JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null,options, / the titles of buttonsoptions0); / default button titleObject possibilities = 苹果, 香蕉, 橘子 ;String s = (String) JOptionPane.showInputDialog(this, 你喜欢什么样的水果?:n,Customized Dialog, JOptionPane.QUESTION_MESSAGE, null,possibilities, ham);String inputValue = JOptionPane.showInputDialog(请输入一个值:);