d.pack();
Insets i = d.getInsets(); d.setSize(500 + i.top + i.bottom, d.getPreferredSize().height);
  public int showSaveDialog(Component parent) throws HeadlessException  {    JDialog d = createDialog(parent);    setDialogType(SAVE_DIALOG);    retval = ERROR_OPTION;    d.pack();    d.show();    return retval;  }