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