Java的“如何创建对话框”教程展示了以下代码:
//custom title, custom icon
JOptionPane.showMessageDialog(frame, "Eggs are not supposed to be green.",
"Inane custom dialog", JOptionPane.INFORMATION_MESSAGE, icon);
这将创建以下对话框:
当图标将被更改为icon
参数时,为什么需要JOptionPane.INFORMATION_MESSAGE
?