java nested for() loop throws ArrayIndexOutOfBoundsException
- by Mike
I'm working through a JPanel exercise in a Java book. I'm tasked with creating a 5x4 grid using GridLayout.
When I loop through the container to add panels and buttons, the first add() throws the OOB exception. What am I doing wrong?
package mineField;
import java.awt.*;
import javax.swing.*;
@SuppressWarnings("serial")
public class MineField…