Java JOptionPane Message createPane(int type, String message, int messageMaxLength)

Here you can find the source of createPane(int type, String message, int messageMaxLength)

Description

create Pane

License

Open Source License

Declaration

private static JOptionPane createPane(int type, String message, int messageMaxLength) 

Method Source Code


//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;
            }
        };
    }
}

Related

  1. browse(String url, Component msgParent)
  2. chooseIndex(String message, String messageTitle, Object[] objects, Object initialObject)
  3. chooseObject(String message, String messageTitle, Object[] objects, Object initialObject)
  4. copyToClipBoard(String code, boolean displayMessage)
  5. createPane(Component comp, String msg)
  6. debug(String message)
  7. display2(Component parent, String message, String title, int optionType, int messageType, Icon icon)
  8. displayEditor(Component parent, String title, String msg)
  9. displayInputMessage(String title, String message, String defaultInput)