-1

我正在为我的 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

请帮忙,这个项目很快就要到期了,我不知道该怎么处理这个错误。

4

2 回答 2

2
private void paintSquare(Graphics g1, int x, int y); {

应该

private void paintSquare(Graphics g1, int x, int y) {

参数后的分号会破坏您的代码。

于 2015-01-13T19:12:29.317 回答
2

删除参数列表后的分号。

private void paintSquare(Graphics g1, int x, int y) {
于 2015-01-13T19:10:39.023 回答