From javadoc on JOptionPane:
public static void showMessageDialog(Component parentComponent, Object message, String title, int messageType, Icon icon) throws HeadlessException
Just create an Icon your image and add it as the 5th parameter.
JOptionPane.showMessageDialog(null, textArea, "Border States", JOptionPane.PLAIN_MESSAGE, image2);
Remember to define image2 before using it (move the line up)
source share