开发者

gwt tooltip with a delay

I need to implement a tooltip with a time delay, say, when user point to a widget, the tooltip popup 2 seconds later. i tried the timer but then it shows again and again, i guess that's because the timer fire the tooltip every VISIBLE_DELAY seconds. is there anyway 开发者_开发技巧i can fire it only once? or is there any Class that can sleep for 2 seconds then i can call tooltip.show()? Thanks.

    removeDelay = new Timer() {
       @Override
        public void run() {

            ToolTip.this.show();
        }
    };
    removeDelay.schedule(VISIBLE_DELAY);


Call cancel after you show the tooltip.

new Timer() {
       @Override
        public void run() {

            ToolTip.this.show();
            cancel();
        }
    };
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜