Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Mouse event problem w/ JLabel within JTable

843804Apr 19 2005 — edited Apr 19 2005
Hello:
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
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 17 2005
Added on Apr 19 2005
1 comment
55 views