I'd start with a single piece. Define it, locate it in a square and draw it in that square.
Then work on how to move it from one square to another square.
When that is working, move on to having...
Type: Posts; User: Norm
I'd start with a single piece. Define it, locate it in a square and draw it in that square.
Then work on how to move it from one square to another square.
When that is working, move on to having...
Where in the code are you trying to display any pieces?
When I execute the program I get a window that looks like the one in the image you posted.
Sorry, I'm not sure now what you are having problems with. What is wrong in the image you posted?
What does the code do now? What is wrong with what it is doing?
Add some printlns to show the...
Are you asking how to find the square's location in the grid where there was a mouse click?
You need to do some arithmetic. Take a piece of paper, draw a grid, mark its x,y location on the paper....
Can you explain what that means? What is the name of the array? How can it be on a corner of a grid?
It depends what a "unit" is. An image or text or what?
The Graphics class has several methods that draw things at an x,y location. If the code changes the x,y locations over time, the thing will...
One way to determine where a user has clicked is to use a mouse listener. The event object passed to the listener has the x,y location of the mouse event. Given that x,y you can find the square...