JOptionPane pane = new JOptionPane(message, messageType, optionType); JDialog dialog = pane.createDialog(parentComponent, title);
JOptionPane pane = new JOptionPane(message); JDialog dialog = pane.createDialog(parentComponent, "Select an Option");
  public static int showConfirmDialog(Component parentComponent,                                      Object message, String title,                                      int optionType, int messageType)  {    JOptionPane pane = new JOptionPane(message, messageType, optionType);    JDialog dialog = pane.createDialog(parentComponent, title);    dialog.pack();    dialog.show();    return ((Integer) pane.getValue()).intValue();  }