For the code below i managed to make these rectangles collide and bound at the Jpanel border, but why is that these rectangle do not bound each other when they collide, instead they overlap each other ?
I think there is a problem within my actionPerformed method. Please tell me why they overlap each other and how to overcome it.
Below is the code.Thank you.
I think there is a problem within my actionPerformed method. Please tell me why they overlap each other and how to overcome it.
Below is the code.Thank you.