Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GWT:can i put Delay for few seconds after showing a popup

Tags:

gwt

I have small GWT application , in which i am showing a popup on success

           if(success){
               DescoratedPopupPanel popup = new DecoratedPopupPanel();
               popup.show();
               //Now here i want to wait for like 5 secs and then 
               popup.hide();
             }

Any idea how can i put a dealay of 5 secs before hiding the popup

Thanks

like image 678
user1226162 Avatar asked Jun 06 '12 11:06

user1226162


1 Answers

Here is the code that uses Timer to produce 5 secs delay:

        final DecoratedPopupPanel popup = new DecoratedPopupPanel();
        popup.show();
        // Now here i want to wait for like 5 secs and then
        Timer timer = new Timer()
        {
            @Override
            public void run()
            {
                popup.hide();
            }
        };

        timer.schedule(5000);
like image 174
Ganesh Kumar Avatar answered Nov 03 '22 00:11

Ganesh Kumar