开发者

gwt tooltip with a delay

开发者 https://www.devze.com 2023-02-15 23:04 出处:网络
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 t

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

精彩评论

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

关注公众号