private void adjustSize(){
  if (bigger(dialog.getPreferredSize(),dialog.getSize())) {
    dialog.pack();
  }
}

private void adjustSize ( ) { if ( bigger ( dialog . getPreferredSize ( ) , dialog . getSize ( ) ) ) { dialog . pack ( ) ; } }
adjusts the size of the dialog to the preferred size , but only if that is bigger than the current size .
