title: JButton Array ActionListener Issue
body: <p>I'm writing a program and I've run into an issue...</p>
  
  <p>I create 1 JLabel array and 1 JButton array.
  The JLabel array holds a string, a Club Name.
  The JButton array holds a string that just says "Edit".</p>
  
  <p>A For loop then fills each array based on the length of the clubs array, as well as add an action listener for each button.</p>
  
  <p>When the user clicks the JButton corresponding to the JLabel it initiates an Event. In this event I need to find out the value stored in the JLabel that matches the JButton.</p>
  
  <p>Since the event listener doesn't know it's inside a loop, I can't use it.</p>
  
  <p>How do I achieve the goal I want?</p>
  
  <p>See the bellow code.</p>
  
  <pre><code>JLabel clubs[]      = new JLabel[99];
  JButton editAClub[] = new JButton[99];
  
  for(int i=0; i &lt;= (allClubs.length - 1);i++)
  {
      clubs[i]        =   new JLabel("Club " + i);
      editAClub[i]    =   new JButton("Edit");
      editAClub[i].addActionListener(new ActionListener()
      {
          public void actionPerformed(ActionEvent e)
          {
              selectedClub = clubs[i].getText().toString();
              System.out.println(selectedClub);
          }
      });
  }   
  </code></pre>