JOptionPane
1.1 showMessageDialog
JOptionPane.showMessageDialog(null, "友情提示");

JOptionPane.showMessageDialog(jPanel, "提示消息", "标题",JOptionPane.WARNING_MESSAGE);

JOptionPane.showMessageDialog(null, "提示消息.", "标题",JOptionPane.ERROR_MESSAGE);
1.2 showOptionDialog
int n = JOptionPane.showConfirmDialog(null, "你高兴吗?", "标题", JOptionPane.YES_NO_OPTION); //n = 0/1

Object[] options ={ "好啊!", "去一边!" }; int m = JOptionPane.showOptionDialog(null, "我可以约你吗?", "标题", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, options, options[0]);

1.3 showInoutDialog
Object[] obj2 ={ "足球", "篮球", "乒乓球" }; String s = (String) JOptionPane.showInputDialog(null, "请选择你的爱好:\n", "爱好", JOptionPane.PLAIN_MESSAGE, new ImageIcon("icon.png"), obj2, "足球"); System.out.println(s);
String title = JOptionPane.showInputDialog(null, "请输入:\n", "title", JOptionPane.PLAIN_MESSAGE);System.out.println(title);

