//default title and icon
JOptionPane.showMessageDialog(frame,"Eggs are not supposed to be green.","Message");
//custom title, warning icon
JOptionPane.showMessageDialog(frame,"Eggs are not supposed to be green.", "Inane warning",JOptionPane.WARNING_MESSAGE);
//custom title, error icon
JOptionPane.showMessageDialog(frame,"Eggs are not supposed to be green.", "Inane error",JOptionPane.ERROR_MESSAGE);
//custom title, no icon
JOptionPane.showMessage......
阅读全文