public void paintSomething(Graphics g) {
drawGrid(g);
for (int up=-1; up<=1; up++) {
for (int left=-1; left<=1; left++) {
if (up != 0 || left != 0)
g.fillRect(LEFT+(specialCol+left)*CELL_WIDTH,
TOP+(specialRow+up)*CELL_WIDTH,
CELL_WIDTH,
CELL_WIDTH);
}
}
}
Add comments that would explain this code to someone unfamiliar with Java. Rename the method to something meaningful.