我正在为我的 AP Comp Sci 课程制作一个名为“Titris”的俄罗斯方块克隆,并且在经历任何错误时,我得到了这个。它来自这段代码
private void paintSquare(Graphics g1, int x, int y) {
Color color = matrix[y][x];
int xMin = x * squareSize.width;
int yMin = y * squareSize.height;
int xMax = xMin + squareSize.width - 1;
int yMax = yMin + squareSize.height - 1;
int i;
bufferRect.x = xMin;
bufferRect.y = yMin;
bufferRect.width = squareSize.width;
bufferRect.height = squareSize.height;
if (!bufferRect.intersects(g1.getClipBounds())) {
return;
}
错误来自paintSquare
请帮忙,这个项目很快就要到期了,我不知道该怎么处理这个错误。