Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3693170
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T04:20:46+00:00 2026-05-19T04:20:46+00:00

I’m trying to understand the timing of the event loop with animate() and DeferredCommand.

  • 0

I’m trying to understand the timing of the event loop with animate() and DeferredCommand. I’ve got LayoutPanel that has a navigation column on the left (like Outlook) and then the remainder of the screen can toggle between being split vertically between 2 panels, or the bottom panel (when it is split) can be set to fill the rest of the screen. I’ve got the layouts and basic animation between them working, but I’m trying to delay the resizing of the bottom screen with a DeferredCommand. The reason for this is that when going from fullscreen to half screen for the bottom panel, I want to resize the bottom panel after reducing it down to half size. If this doesn’t happen, the bottom panel is resized to halfsize while still being displayed full screen, and then the animate happens.

However, this is exactly what is happening, and which I was trying to avoid with the DeferredCommand. So it appears that the DeferredCommand is executing before the animate.

Here’s the code snippet

setWidgetTopHeight(...make top panel half size)
setWidgetTopHeight(...make lower panel half size, positioned halfway down)
animate(500); 
DeferredCommand.addCommand(new Command() {
    public void execute() {
         ...resize Widget inside lower Panel
    }
});

The lower panel that is being resized in the animate is a FlowPanel around the actual widget that is being resized in the DeferredCommand. Could this be part of the problem?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T04:20:47+00:00Added an answer on May 19, 2026 at 4:20 am

    animate() is implemented by a successive number of ScheduledCommands (or the equivalent) – i.e. an animation does not complete in a single iteration of the browser event loop. Note that DeferredCommand is deprecated in GWT 2.1 – Scheduler provides the same functionality. The correct way to perform an action after the animation completes is with an AnimationCallback:

    animate(500, new Layout.AnimationCallback() {
      @Override
      public void onAnimationComplete() {
        // Perform post-animation action.
      }
    
      @Override
      public void onLayout(Layout.Layer layer, double progress) {
        // Ignored.
      }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.