package eecs1022; import java.awt.Color; import javax.swing.JOptionPane; import franck.Grid; public class BlockOfAlernatingCells { public static void main(String[] args) { String input = JOptionPane.showInputDialog("Number of columns"); final int COLUMN = Integer.parseInt(input); input = JOptionPane.showInputDialog("Number of rows"); final int ROW = Integer.parseInt(input); Grid grid = new Grid(COLUMN, ROW); for (int r = 0; r < ROW; r++) { for (int c = 0; c < COLUMN; c++) { if ((c + r) % 2 == 0) { grid.set(c, r, Color.RED); } else { grid.set(c, r, Color.BLUE); } } } } }