Glad you figured it out. Now on to the next problem.
Type: Posts; User: Norm
Glad you figured it out. Now on to the next problem.
For the top line:
What would be the y value for all the images? What would be the range of x values?
For the right line:
what would be the x value for all the images? What would be the range...
What part of the code works? Which of the four lines are drawn correctly: Left, top, right or bottom?
Which ones are you having trouble with?
Your println should be immediately following...
If you want the y values to change (keeping the x value constant) then you will be drawing the images in a column.
What you posted was for the images to be in a row not a column. What does the...
That print out was for putting images on a row (y=115)
What did you want that code to do differently? Where were those images supposed to go? What should be the x and y values to put the images...
The images for that print out would be on a row(y=115) going from left to right from 31 to 157.
What does the print out look like for when the images do not go where you want them to go?
No need...
The = are part of the String to be printed. The above would print out something like this:
var=234, anotherVar=34, andMore=333
The "s define Strings. The +s concatenate all the Strings into...
To get debug output so you can see what the code is doing, print the values of the variables using:
System.out.println("var=" + var + ", anotherVar="
+ anotherVar + ", andMore=" +...
Where is the print out of the values of the x and y locations where you are drawing the images?
I don't see any println statements in the code you posted. Add some println statements to print out...
Look at the code to get the names of the variables. You are probably correct with their names.
Please post the print outs that shows the x and y values of where the image is being draw and the...
Please post the print outs that shows the x and y values of where the image is being draw and the code that generated the output.
For testing you should reduce the width and height to a smaller...
What prints out when you add the println to print the x,y locations for each of the images you are drawing?
I assume that the x,y locations are the problem you are having, so if you print them out...
Can you post the code did that?
Try debugging the code by adding printlns that print the values of x and y where the images are being drawn.
There are 4 areas to put the images in: two rows and two columns
To put images in a row, change the x value, leave the y value unchanged.
To put images in a column, change the y value, leave the x...
Draw the grid of images. Write down the x,y value for each of the 4 sides and look at how the x,y values change for each of the 4 areas you are putting images into.
The easiest solution looks like...
You should be able to use loops. There are two rows and two columns
Control the values of x and y to place the images where you want them drawn.
The nested loops look ok. The ending } for the outer loop is missing. Is there any code is missing?
Add a call to print() that prints out the x and then all the y values on each column for each...