private void drawSquare (Graphics g, int row, int col,
Tetrominoes shape){
Color[] colors={new Color(0,0,0), new Color(204,102,102),
new Color(102,204,102), new Color(102,102,204),
new Color(204,204,102), new Color(204,102,204),
new Color(102,204,204), new Color(218,170,0)
};
int x = col * squareWhidth();
int y = row * squareHeight();
Color color = colors[shape.ordinal()]; // **** NullPointerException here ****
g.setColor(color);
g.fillRect(x + 1, y + 1, squareWhidth() - 2,
squareHeight() - 2);
g.setColor(color.brighter());
g.drawLine(x, y + squareHeight() - 1, x, y);
g.drawLine(x, y, x + squareWhidth() - 1, y);
g.setColor(color.darker());
g.drawLine(x + 1, y + squareHeight() - 1,
x + squareWhidth() - 1, y + squareHeight() - 1);
g.drawLine(x + squareWhidth() - 1,
y + squareHeight() - 1,
x + squareWhidth() - 1, y + 1);
}
Throws me a nullpointerexception when I run the program and the terminal reference me in this line: Color color = colors[shape.ordinal()];