dialog.setLocationRelativeTo(parentComponent);
  public static String showInputDialog(Component parentComponent,                                       Object message)  {    JOptionPane pane = new JOptionPane(message, QUESTION_MESSAGE);    pane.setWantsInput(true);    JDialog dialog = pane.createDialog(parentComponent, null);    dialog.pack();    dialog.show();    return (String) pane.getInputValue();  }