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