I\'m trying to build a program that utilizes a 3x3 grid of buttons (using Java Swing), so I initialize it with a GridLayout and a loop to create the buttons:
you already keep a track of the buttons by the array index i.e. buttray[i]. Use getSource()
public void actionPerformed(ActionEvent e) { // TODO Auto-generated method stub for(int i=0;i