I have a JTreeTable and successfully implemented MouseMotionListener to show a tooltip whenever the mouse is over one of the cells. However, when you click on a cell, a tooltip does not appear. I tried several things, such as setting text in mouseClicked and mouseReleased , but this does not 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); }
for use in the mouseReleased method, which makes the tooltip popup , but it is in the wrong position. So, I tried to override the getTooltipLocation method on JTreeTable , and this works great for mouseMoved events, but it is not called using the above method. Can anyone shed some light on how to do this?
Thanks Andy
user935339
source share