Is that the result of on too many setColor()?
Or perhaps not enough calls to setColor()?
Type: Posts; User: Norm
Is that the result of on too many setColor()?
Or perhaps not enough calls to setColor()?
You need to figure out where the x,y locations are for each square you want to print.
Take a piece of paper and draw what you want the output to look like. Just the outer border for now.
Then...
Can you screen print and post it.
Here's what I get with my version:
One problem is that the board is not square. The for loop tests have the wrong end of loop test. I think it should be:
for (y=0; y<board[x].length; y++)
You don't say if your code is working...
I don't see any comments in the code so I don't know what its supposed to do.
The contents of the window is all black.
You need to post code that will compile and execute. That helps seeing what the problem is.
The code you posted has several syntax errors in it.
Is that what your method draws?
Try debugging your code by adding println statements to show the values of the variables used to control where the drawing takes place.
Hard to say what the...
What variable is null at line 85 in Spillbrett.java?
Backtrack in your code to see why the variable does NOT have a value.
You should use the one passed to the paint method.
can you copy and paste the full text of the error messages here?
They contain information about what was wrong which is needed to fix the problem.
One problem I see, you need to pass a reference...