Basic Java drawing program: issue with squares

Posted by Caminek on Programmers See other posts from Programmers or by Caminek
Published on 2013-10-19T15:38:37Z Indexed on 2013/10/19 16:07 UTC
Read the original article Hit count: 163

Filed under:
|

I'm trying to create a simple drawing program that creates a square where the user clicks and drags.

The square displays correctly as long as either x or y remain positive with respect to the original click position.

If both x and y are negative with respect to the original click position, the square grows/shrinks, but also wanders about the screen.

Is there a way to swap the origin point from top-left to bottom-right or to keep the square from wandering?

© Programmers or respective owner

Related posts about java

Related posts about swing