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();
}
}
}
);
dismissButton.addActionListener( new CustomListener() );
...
private static class CustomListener implements ActionListener
{
/**
* close down the Dialog when user clicks Dismiss
*/
public void actionPerformed ( ActionEvent event )
{
Object object = event.getSource();
if ( object == dismissButton )
{
dismiss();
}
}
}