dialog.pack(); dialog.setLocationRelativeTo(parentComponent);
  public JDialog createDialog(Component parentComponent, String title)  {    Frame toUse = getFrameForComponent(parentComponent);    if (toUse == null)      toUse = getRootFrame();    JDialog dialog = new JDialog(toUse, title);    inputValue = UNINITIALIZED_VALUE;    value = UNINITIALIZED_VALUE;    // FIXME: This dialog should be centered on the parent    // or at the center of the screen (if the parent is null)    // Need getGraphicsConfiguration to return non-null in    // order for that to work so we know how large the     // screen is.    dialog.getContentPane().add(this);    dialog.setModal(true);    dialog.setResizable(false);    return dialog;  }