Rectangle left = new Rectangle(0,0,WIDTH/9,HEIGHT); In this code, if I increase the width why does it look like it extends farther over to the left on the JFrame? And if I decrease it why does it extend out to the right? Does this not work like a coordinate plain? Height makes a little more sense to me. If height is increased it extends up and if it is decreased it extends down.
Asked
Active
Viewed 400 times
0
-
1Please post the code you are using to display the Rectangle. – Jamie May 21 '12 at 00:05
-
1The code you've posted does not jibe with the behavior your describing. I'm with @Jamie: show us more code, preferably an [sscce](http://sscce.org). – Hovercraft Full Of Eels May 21 '12 at 00:15
1 Answers
2
Swing draws with 0,0 being the top left corner, with positive X extending out to the right, and positive Y extending downwards. This can be confusing as some people expect 0,0 to be the bottom left corner.
If you are having trouble figuring out where thing are as opposed to where you think they would be, i would suggest just drawing the points of your shapes, and play around with that rather then trying to draw rectangles etc first.

dann.dev
- 2,406
- 3
- 20
- 32