@@ -0,0 +1,808 @@
+import java.util.*;%0Aimport java.io.*;%0Aimport java.awt.*;%0Aimport java.awt.event.*;%0Aimport javax.swing.*;%0Aimport javax.swing.event.*;%0Aimport javax.swing.text.*;%0A%0Apublic class Board extends JPanel%0A%7B%0A%09int size;%0A%09Cell%5B%5D%5B%5D grid;%0A%09%0A%09public Board(int size, Cell%5B%5D%5B%5D grid)%0A%09%7B%0A%09%09this.size = size;%0A%09%09this.grid = grid;%0A%09%09setPreferredSize(new Dimension(size*(grid%5B0%5D.length), size*(grid.length)));%0A%09%7D%0A%09%0A%09public void paintComponent(Graphics g)%0A%09%7B%0A%09%09for (int i = 0; i %3C grid.length; i++)%0A%09%09%7B%0A%09%09%09for (int j = 0; j %3C grid%5B0%5D.length; j++)%0A%09%09%09%7B%0A%09%09%09%09g.setColor(Color.WHITE);%0A%09%09%09%09if (grid%5Bi%5D%5Bj%5D.getState() == 1) g.setColor(Color.LIGHT_GRAY);%0A%09%09%09%09else if (grid%5Bi%5D%5Bj%5D.getState() == 2) g.setColor(Color.GRAY);%0A%09%09%09%09else if (grid%5Bi%5D%5Bj%5D.getState() == 3) g.setColor(Color.RED);%0A%09%09%09%09g.fillRect(j*size, i*size, size, size);%0A%09%09%09%7D%0A%09%09%7D%0A%09%7D%0A%7D%0A

Create Board.java