I'm trying to get a square on a checkerboard to become highlighted when the user clicks on the rectangle. I created all my squares using fillRectangle methods. I'm not sure how to begin implementing this in the mouse adapter.

Only the border of the square needs to be highlighted. Would I accomplish this by just creating an equal size rectangle over the one clicked on but changing the stroke size? Also I'm guessing I could tell where the mouse was clicked by using the getx and y methods but then I'm not sure on how to determine the dimensions I guess of the square clicked.

Any thoughts and/or suggestions would be great. I plan on using MousePressed for the event. Thanks!

Welcome to Daniweb.

>equal size rectangle over the one clicked on but changing the stroke size?

Great idea.

>I'm not sure on how to determine the dimensions I guess of the square clicked.

contains (point) method of rectangle.