GridLayout + Mouse Listener
问题 Okay guys I have a problem, I dont know how know which cell was clicked on a grid layout, is there any function? I have grid layout on container, for 10 rows and 10 columns, and what I want is a mouse listener to all the cells, so when I click cell (2,1) it would say which cell I am clicking because of the mouse listener. Any clues? thanks alot in advance 回答1: Add a MouseListener to the Container that uses GridLayout and that holds the components in the grid. Then on mousePressed use the