且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

子菜单中的GWT MenuItem具有零getAbsoluteTop()getAbsoluteLeft()

更新时间:2023-12-06 14:48:40

最有可能,您要求在菜单项完全呈现之前输入坐标.尝试使用调度程序( GWT:计时器和调度程序类)等待直到菜单项完全呈现,然后在execute方法内询问坐标.

Most likely, you ask for the coordinates before the menu item is fully rendered. Try using a Scheduler (GWT: Timer and Scheduler Classes) to wait until the menu item is fully rendered and then ask for the coordinates inside the execute method.