private void endGame(boolean won)
    {
    	for(int row = 0; row < rows; row++) {
    		for(int col = 0; col < cols; col++) {
    			JButton button = buttonGrid[row][col];
    			if(base.getSquare(row, col).getIsAMine()) {
    				button.setText("M");
    				if(won) {
    					button.setBackground(Color.green);
    				}
    				else {
    					button.setBackground(Color.red);
    				}
    			}
    			base.getSquare(row, col).setPressed();
    			button.setEnabled(false);
    			finished = true;
    		}
    	}
    	if(won) {
    		JOptionPane.showMessageDialog(this, "Congratulations.\n"
					+ "You Win!", "Game Finished", 1);
    	}
    	else {
    		JOptionPane.showMessageDialog(this, "You hit a mine.\n"
        			+ "You lose!", "Game Finished", 1);
    	}
    }