News
A much better solution is to add the MouseListener to the Panel or Canvas to which you are drawing all these squares. Then, in that MouseListener, do calculation to determine which square was clicked.
Some results have been hidden because they may be inaccessible to you
Show inaccessible results