views:

777

answers:

1

I have a JTable with a set of uneditable cells and I want all the cells in a particular column to have a different mouse cursor displayed whilst the mouse is hovering over them. I am already using a custom renderer and setting the cursor on the renderer component doesn't seem to work (as it does for tooltips).

It does seem to work for editors.

Is this not possible in JTable when your cell is not being edited or am I missing something?

+1  A: 

Add a MouseMotionListener to the JTable and then on mouseMoved() determine which column it is using JTable's columnAtPoint() and if it's the particular column you are after, setCursor() on the JTable.

Kevin Herron
I'll accept the answer because this is what we were doing already and it works. I was hoping to find something a little nicer though.
Tom Martin