I have included tooltips in JTable by overriding the JComponent method that inherits JTable:
public String getToolTipText(MouseEvent e) { ... }
Now suppose that the user is hanging over a cell, a tooltip appears, and then (a) he starts editing the cell, I want to forcefully reject the tooltip.
Currently, the tooltip just hangs until the value that I specified using ToolTipManager # setDismissDelay expires. The tooltip can sometimes hide the view of the cell being edited, so I want to reject it at the moment when any cell on the table goes into edit mode.
I tried the following approach (this is pseudo code)
public String getToolTipText(MouseEvent e) { if(table-is-editing) return null; else return a-string-to-display-in-the-tooltip; }
Of course, this only action DOES NOT show the table tooltips ALREADY in edit mode. I knew this would not work, but it was more like a shot in the dark.
source share