How to make sure that drawn shapes on JPanel is not overlapping?

You'll need to change while ((xSquare + squareSize) >= xRing && xSquare = yRing && ySquare.

Thanks, but it keeps overlapping! – RCola Dec 3 at 17:16 why do you assume that "ringSize is the radius of the circle, not the diameter. " - it is the value of weight and height, and they equal each other - therefore it is diameter!

– RCola Dec 3 at 17:31 @RCola OK, I checked the API: ringSize is the diameter. Check my new condition; I think it will work. I guess you always had overlaps with a square to the left (or higher) of the ring, which I fixed.

– toto2 Dec 3 at 17:38 I don't understand how, but this solution works. Any ideas? – RCola Dec 3 at 17:39 You can have a square with its left edge to the left of the ring, but the right edge of the square is inside the ring.

Your original condition considered that a non-overlap, mine does. – toto2 Dec 3 at 17:43.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions