This week's book giveaway is in the Mac OS forum. We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line! See this thread for details.
Paul Clapham wrote:To make sure those two objects are not the same object you do this:
Was that what you meant?
Yes, I'm not sure how .equals() would work with an object like that, but it works fine.
I managed to find the solution myself, when x and y were changing, all the of rectangles were not updated, so therefore creating a loop decreasing x and y when they weren't updating to their new positions after each loop resulted in an endless loop, thus causing the error.