JTable tooltip issues

I have a JTable in which each cell consists of a custom renderer. When

the user has their mouse over a certain column, I'd like for them to see my tooltip.

I can implement all of this just fine, but here is my issue --

when the user moves from one cell to the other, the tooltip never goes away, so essentially -- once the tooltip is displayed, it stays up indefinitely until the user leaves that particular column (since the other columns are not set to use tooltips).

I have tried all of the following:

overridden the JTable getToolTipText method

added a mouse listener to the table and tracked when a new cell was under the mouse and then tried to disable tooltips and then re-enable-- didn't work -- tried to unregister my table and then re-register -- didn't work.

I've now added the tooltip to the renderer components and it does the same thing.

I have to keep my dismiss delay set to Integer.MAX_VALUE for other reasons (my portion of the code is a small subset of the whole).

Basically is there any way to tell the tooltip to hide/dismiss itself and restart the initialdelay timer, or am I going to have to implement my own custom tooltip manager?

Thanks.

[1235 byte] By [cochranjda] at [2007-11-27 9:17:29]
# 1

I may have a solution (seems to work).

I implemented a timer and whenever a cell change occurs (through mouseMostionListener) I start my timer (50 ms). when I start the timer (right before, actually) I set a flag instructing my getToolTipText in the JTable to return null. When the timer expires, it sets the flag to let the method fetch the actual tooltip.

This seems to restart the initial delay when I traverse different cells.

Any better ideas?

cochranjda at 2007-7-12 22:07:59 > top of Java-index,Desktop,Core GUI APIs...