osx - JTooltip in JTable on Mac in Java does not select the row when clicked on -
on windows if click on table tooltip (jtooltip), remove tooltip , select row in table. on mac, seems remove tooltip , not select row in table.
the code uses standard jtable , overrides gettooltiptext method jtable. no custom jtooltip created or that.
code:
public class myjtable extends jtable { @override public string gettooltiptext(mouseevent event) { return "hello world"; } }
**update: on further investigation issue seems due similar bug report. tooltipmanager.showtipwindow() creating tooltip heavyweight component on mac , lightweight component on windows, causes mouselistener not fired. worse part regardless if set popuptype lightweight, still create heavyweight component in method when java code calls popupfactory.getpopup(...)
no idea how fix it.
normally different tooltip given each row or cell , not entire table. move mouse tooltip changes , displayed in different location never opportunity click on tooltip.
so, maybe alternative approach, override gettooltiplocation()
method:
public point gettooltiplocation(mouseevent e) { return new point(e.getx(), e.gety() + 10); }
now user never able click on it.
Comments
Post a Comment