class yourclass
{
  ...
  button.addActionListener(this);
  ...
  yourmethod()
  {
     ...
  }
  ...
  public void actionPerformed(ActionEvent e)
  {
     if(e.getSource()==button)
     {
         yourmethod();
      }
  }
  ...
}