//JOptionPane.showMessageDialog(parentComponent, message, title, messageType, icon);
JOptionPane.showMessageDialog(null, "message", "title",JOptionPane.INFORMATION_MESSAGE,new ImageIcon("psb.jpg"));
JOptionPane.showConfirmDialog(null, "message", "title",JOptionPane.YES_NO_CANCEL_OPTION,JOptionPane.QUESTION_MESSAGE);
//JOptionPane.showConfirmDialog(parentComponent, message, title, optionType, messageType, icon);
JOptionPane.showConfirmDialog(null, "message", "title",JOptionPane.YES_NO_CANCEL_OPTION,JOptionPane.QUESTION_MESSAGE,new ImageIcon("psb.jpg"));
String str [] = {"篮球","足球","排球"};
//JOptionPane.showInputDialog(parentComponent, message, title, messageType, icon, selectionValues, initialSelectionValue)
JOptionPane.showInputDialog(null, "message", "title",JOptionPane.INFORMATION_MESSAGE,new ImageIcon("psb.jpg") ,str, str[0]);
String str [] = {"篮球","足球","排球"};
//JOptionPane.showOptionDialog(parentComponent, message, title, optionType, messageType, icon, options, initialValue)
JOptionPane.showOptionDialog(null,"message","title",JOptionPane.YES_NO_OPTION,JOptionPane.QUESTION_MESSAGE,new ImageIcon("psb.jpg"),str,str[0]);
函数字段中存在 Internal 则该提示框 parentComponent 不能为空。