JButton average = new JButton("Average");
add (average);
average.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
JButton source = (JButton)e.getSource();
{
I am using gridLayout to create a GradeBook. I am adding a new gridlayout at the bottom to add a row of buttons. I want to click on an "average" button, and total up the numbers in the column above the button and calculate an average based on the number of rows that are there. The array is created by asking the user how many rows and columns are needed, so this information can change.