The flag also indicates which message style to use on the window decorations, see http://nadeausoftware.com/node/91#Usinglookandfeelspecificwindowdecorations
from the JOptionPane class source code:
private static int styleFromMessageType(int messageType) {
switch (messageType) {
case ERROR_MESSAGE:
return JRootPane.ERROR_DIALOG;
case QUESTION_MESSAGE:
return JRootPane.QUESTION_DIALOG;
case WARNING_MESSAGE:
return JRootPane.WARNING_DIALOG;
case INFORMATION_MESSAGE:
return JRootPane.INFORMATION_DIALOG;
case PLAIN_MESSAGE:
default:
return JRootPane.PLAIN_DIALOG;
}
}
and in the method showOptionDialog which is called by showMessageDialog...
int style = styleFromMessageType(messageType);
JDialog dialog = pane.createDialog(parentComponent, title, style);