@Override public void actionPerformed(ActionEvent e){
  if (e.getSource() == ok) {
    closeAction=ACTION_OK;
  }
  setVisible(false);
}

@ Override public void actionPerformed ( ActionEvent e ) { if ( e . getSource ( ) == ok ) { closeAction = ACTION_OK ; } setVisible ( false ) ; }
when a button was pressed , close dialog , change closeaction when the ok - button was pressed .
