package eecs1022; import java.awt.Color; import javax.swing.JOptionPane; import franck.Grid; public class Diamond { public static void main(String[] args) { String input = JOptionPane.showInputDialog("Size"); final int SIZE = Integer.parseInt(input); Grid grid = new Grid(2 * SIZE + 1, 2 * SIZE + 1); for (int r = 0; r <= SIZE; r++) { grid.set(SIZE - r, r, Color.RED); grid.set(SIZE + r, r, Color.RED); } for (int r = SIZE + 1; r <= 2 * SIZE; r++) { grid.set(r - SIZE, r, Color.RED); grid.set(3 * SIZE - r, r, Color.RED); } } }