title: Add multiple actionListener to multiple JButtons
body: <p>I am working on a GUI and trying to get different buttons to perform different tasks. </p>
  
  <p>Currently, each button is leading to the same ActionListener.</p>
  
  <pre><code>public class GUIController {
  
  public static void main(String[] args) {
      javax.swing.SwingUtilities.invokeLater(new Runnable() {
          public void run() {
              createAndShowGUI();
          }
      });
  }
  public static void createAndShowGUI() {
      JFrame frame = new JFrame("GUI");
      frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      frame.getContentPane().setLayout(new GridLayout(3,3));
  
      JLabel leight =new JLabel("8");
      frame.getContentPane().add(leight);
      JLabel lfive =new JLabel("0");
      frame.getContentPane().add(lfive);
      JLabel lthree =new JLabel("0");
      frame.getContentPane().add(lthree);
  
      JButton beight =new JButton("Jug 8");
      frame.getContentPane().add(beight);
      JButton bfive =new JButton("Jug 5");
      frame.getContentPane().add(bfive);
      JButton bthree =new JButton("Jug 3");
      frame.getContentPane().add(bthree);
  
      LISTN ccal = new LISTN (leight,lfive,lthree);
  
      beight.addActionListener(ccal);
      bfive.addActionListener(ccal);
      bthree.addActionListener(ccal);
  
      frame.pack();
      frame.setVisible(true);
  
  }
  
  }
  </code></pre>
  
  <p>my actionlistener file</p>
  
  <pre><code>public class JugPuzzleGUILISTN implements ActionListener {
  JLabel leight;
  JLabel lfive;
  JLabel lthree;
  
  JugPuzzleGUILISTN(JLabel leight,JLabel lfive, JLabel lthree){
      this.leight = leight;
      this.lfive = lfive;
      this.lthree = lthree;
  }
  
  public void actionPerformed(ActionEvent e) {
      }
  
  }
  }
  </code></pre>
  
  <p>Anything I write in ActionEvent applies to all three buttons, how can I make it so that each button has their own function?
  Thank you so much!</p>