@@ -0,0 +1,1174 @@
+/**%0A * @(#)SnakeGrid.java%0A *%0A *%0A * @authors Martin Verde%0A * @version 1.00 2014/5/7%0A */%0Aimport javax.swing.JFrame;%0Aimport javax.swing.JPanel;%0Aimport java.awt.Color;%0Aimport java.awt.Dimension;%0Aimport java.awt.GridLayout;%0A%0Apublic class SnakeGrid extends SnakeObject %0A%7B%0A%09private JFrame frame = new JFrame();%0A%09private static final int WIDTH = 320;%0A%09private static final int HEIGHT = 320;%0A%09private static final int SCALE = 2;%0A%09private JPanel%5B%5D%5B%5D grid;%0A%09%0A%09public SnakeGrid(int width, int length)  //constructs a grid of JPanels with int parameters for dimensions of the grid%0A%09%7B%0A%09%09frame.setLayout(new GridLayout(width, length));%0A%09%09grid = new JPanel%5Bwidth%5D%5Blength%5D;%0A%09%09for(int y=0; y%3Clength; y++)%0A%09%09%7B%0A%09%09%09for(int x=0; x%3Cwidth; x++)%0A%09%09%09%7B%0A%09%09%09%09grid%5Bx%5D%5By%5D = new JPanel();%0A%09%09%09%09frame.add(grid%5Bx%5D%5By%5D);%0A%09%09%09%09grid%5Bx%5D%5By%5D.setBackground(Color.GRAY);%0A%09%09%09%7D%0A%09%09%7D%0A%09%09frame.setPreferredSize(new Dimension(WIDTH * SCALE, HEIGHT * SCALE));%0A%09%09frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);%0A%09%09frame.pack();%0A%09%09frame.setVisible(true);%0A%09%7D%0A%09%0A%09public JPanel%5B%5D%5B%5D getGrid()  //returns the 2D array of JPanels%0A%09%7B%0A%09%09return grid;%0A%09%7D%0A%09public void closeFrame()  //exits the game%0A%09%7B%0A%09%09frame.setVisible(false);%0A%09%7D%0A%7D%0A

Create SnakeGrid.java