I have a JTreeTable
and have successfully implemented a MouseMotionListener
to show a tooltip whenever the mouse is over one of the cells. However when clicking on the cell the tooltip does not show up. I've tried several things like setting the text on the mouseClicked
and mouseReleased
events but that doesn't work. I found this code -
Action toolTipAction = treeTable.getActionMap().get("postTip");
if(toolTipAction != null){
ActionEvent postTip = new ActionEvent(treeTable,ActionEvent.ACTION_PERFORMED, "");
toolTipAction.actionPerformed(postTip);
}
to use in the mouseReleased
method, which does make the tooltip popup
, but it's then in the wrong position. So next i tried overriding the getTooltipLocation
method on the JTreeTable
, and this works fine for mouseMoved
events but doesn't get called with the above method. Can anyone shed some light on how to do this?
Thanks Andy