JOptionPane pane = new JOptionPane(message, messageType); JDialog dialog = pane.createDialog(parentComponent, title);
JOptionPane pane = new JOptionPane(message, INFORMATION_MESSAGE); JDialog dialog = pane.createDialog(parentComponent, null);
  public static void showMessageDialog(Component parentComponent,                                       Object message, String title,                                       int messageType)  {    JOptionPane pane = new JOptionPane(message, messageType);    JDialog dialog = pane.createDialog(parentComponent, title);    dialog.pack();    dialog.show();  }