// This code goes in your Dialog class // to shutdown the Dialog // when the user clicks the Dismiss Button. dismissButton.addActionListener ( new ActionListener() { /** * close down the Dialog when user clicks Dismiss */ public void actionPerformed ( ActionEvent event ) { Object object = event.getSource(); if ( object == dismissButton ) { dismiss(); } // end if } // end actionPerformed } // end anonymous class ); // end addActionListener line