From what I read, I think you need to add a MouseListener to your table, which, for example, in mouseClicked, will get a row and column using the following code:
table.addMouseListener(new MouseListener() { @Override public void mouseClicked(MouseEvent e) { Point pnt = evt.getPoint(); int row = table.rowAtPoint(pnt); int col = table.columnAtPoint(pnt); } }
It is perfect for you. I used to use a similar thing. By the way, this looks like a problem I found on coderanch, link: http://www.coderanch.com/t/332737/GUI/java/detect-single-click-any-cell
Good luck Boro
source share