What were the last values that printed out before you got the error:
ArrayIndexOutOfBoundsException: -5
Are you getting the error still?
Type: Posts; User: Norm
What were the last values that printed out before you got the error:
ArrayIndexOutOfBoundsException: -5
Are you getting the error still?
The problem with the way this prints out is that you do NOT see the values of x and y. You see the sum of the variables.
Try this: System.out.println("x=" + x + ", y" + y);
What was the last...
Do you know what a variable is?
Do you know what variables are being used to compute the indexes to the arrays?
Those are what you should print out. Show the variables' values.
The variables you...
No. Comments do not cause anything to print out.
Do you know what a variable is?
Do you know what variables are being used to compute the indexes to the arrays?
Those are what you should print...
println refers to the println method of the out variable in the System class.
You use it like this:
System.out.println("var=" + var); // print the value of var
You need to print out the values...
That error message was BEFORE you added the println. What about AFTER you added the println?
Where are the print outs of the values used in the line where the index value is wrong?
Did you add a...
I don't see how a println statement can cause errors.
Please copy and paste here the full text of the error messages.
Add a println just before the statement with the invalid index to print out the contents of all the variables used in the computing the index.
What are the values of x, y and width when this statement is executed?
Could the value of the expression be -6?
Have you looked at the lines in your code where the array index goes out of bounds and determined why it gets a bad value? What code is at line 34 in Screen.java? Or line 105 in EscapeComponent.java