Mouse event problem w/ JLabel within JTable
843804Apr 19 2005 — edited Apr 19 2005Hello:
I have a situation where I am creating a custom cell renderer and editor for a JTable using a JLabel. The JLabell editor has a mouse event attached to it that when triggered is supposed to perform some function on the selected rows of the JTable.
The problem is that when the mouse event on the JLabel is fired, the row selection within the JTable has not yet occurred and therefore my list of selected rows is null
I was thinking that I might be able to programmatically select the row from the mousePressed method of my listener but am not sure how I would do this. I know that there is a getRowAtPoint method within the JTable class, however, the point reference that I am getting I believe is based on the component, not the table.
Any advise would be greatly appreciated.
Kenneth