Here you can find the source of createPane(int type, String message, int messageMaxLength)
private static JOptionPane createPane(int type, String message, int messageMaxLength)
//package com.java2s; import javax.swing.*; public class Main { private static JOptionPane createPane(int type, String message, int messageMaxLength) { JOptionPane pane = createMaxLengthOptionPane(messageMaxLength); pane.setMessageType(type);//from ww w .j a va 2s .co m pane.setMessage(message); return pane; } public static JOptionPane createMaxLengthOptionPane(final int maxLength) { return new JOptionPane() { @Override public int getMaxCharactersPerLineCount() { return maxLength; } }; } }