title: How to set the ActionListener for multiple different nameless JButtons. How can they be treated independently when they all have the same or no name?
body: <p>Here is an example. I have a grid of different buttons (adding each to Grid Layout) and I don't want names for any of them but want to carry out different commands for each of them. How can I tell the difference when Overriding actionPerformed?    </p>
  
  <pre><code>/* MULTIPLE BLANK JBUTTONS WHAT DO????????? */
      JButton temp;
      for(int i = 0; i &lt; BOARD_WIDTH*BOARD_HEIGHT; i++){
          temp = new JButton();
          temp.setActionEvent("a" + i);
          temp.addActionListener(new ActionListener{
                  //Anonymous Class????? Is there a better way?
              }
          });
          this.add(temp);
  </code></pre>