JOptionPane has following different message styles that can be used according to the requirement:

- ERROR_MESSAGE
- INFORMATION_MESSAGE
- WARNING_MESSAGE
- QUESTION_MESSAGE
- PLAIN_MESSAGE

Java Code:
		
JOptionPane.showMessageDialog(null, "error", "error",
   JOptionPane.ERROR_MESSAGE);
JOptionPane.showMessageDialog(null, "info", "info",
   JOptionPane.INFORMATION_MESSAGE);
JOptionPane.showMessageDialog(null, "warning", "warning",
   JOptionPane.WARNING_MESSAGE);
JOptionPane.showMessageDialog(null, "question", "question",
   JOptionPane.QUESTION_MESSAGE);
JOptionPane.showMessageDialog(null, "plain", "plain",
   JOptionPane.PLAIN_MESSAGE);