The other style that Eric mentions would look like this, either gets the job done so it's really just a matter of preference:
public class Example implements ActionListener
{
public Example()
{
JButton button = new JButton( "Example" );
button.addActionListener( this );
}
public void actionPerformed( ActionEvent event ) {
JOptionPane.showMessageDialog( null, "This is an example" ) ;
}
}
Greetings
Albert