title: Class of Event handlers
body: <p>is it possible in java to have a class where it has EventHandlers for with different functions? for example button1 will log you in, while button2 will log you out, is this possible? Here's the code I made it seems to be not working.</p>
  
  <pre><code>package event.handlers;
  
  import java.awt.event.ActionEvent;
  import java.awt.event.ActionListener;
  
  public class TheHandler implements ActionListener {
  
      @Override
      public void actionPerformed(ActionEvent logInEvent) {
          System.out.println("Button Login");
      }
  
      public void actionPerformed(ActionEvent cancelEvent) {
          System.out.println("Cancel Login");
      }
  }
  </code></pre>