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

  • SEARCH
  • Home
  • 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 6228669
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T09:25:46+00:00 2026-05-24T09:25:46+00:00

I know GWT is single threaded by nature, however I am trying to user

  • 0

I know GWT is single threaded by nature, however I am trying to user deferred command to emulate a multi-threaded effect. I am trying to implement a text animation which is controlled by the isBusy boolean variable, which the text manipulation (animation effect) runs unti isBusy gets false value, when the server responded already. However this code seems to get stuck with the while-loop?

Here is the code:

    loginButton.addClickHandler(new ClickHandler() {
        @Override
        public void onClick(ClickEvent event) {
            isBusy = true; // boolean
            // Show animating effect...
            Scheduler.get().scheduleDeferred(new ScheduledCommand() {
                @Override
                public void execute() {
                    while(isBusy == true) {
                        for (int i=0;i<3;i++) {
                            if (i==0) { loginButton.setText("."); }
                            if (i==1) { loginButton.setText(".."); }
                            if (i==2) { loginButton.setText("..."); }
                        }
                    }
                }
            });
            loginService.getUser(usernameBox.getText(), passwordBox.getText(), new AsyncCallback<User>() {
                @Override
                public void onSuccess(User result) {
                    isBusy = false;
                }
                @Override
                public void onFailure(Throwable caught) {
                    isBusy = false;
                }
            });
        }
    }); 
  • 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-24T09:25:47+00:00Added an answer on May 24, 2026 at 9:25 am

    Scheduler was the right tool, but you are using the wrong command. You have to use scheduleFixedPeriod insdead of scheduleDeferred. Here is a small example which showes hopefully helps you.

    @Override
    public void onModuleLoad() {
        final Label l = new Label("");
        RootPanel.get().add(l);
    
        Scheduler.get().scheduleFixedPeriod(new RepeatingCommand() {
    
            @Override
            public boolean execute() {
                    int i = l.getText().length();
    
                    if (i == 0) {
                        l.setText(".");
                    }
                    else if (i == 1) {
                        l.setText("..");
                    }
                    else if (i == 2) {
                        l.setText("...");
                    }
                    else if (i == 3) {
                        l.setText("");
                    }
                return true;    //as long as it returns true the execute is repealed after XX milliseconds 
            }
        }, 200);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to use : http://code.google.com/p/jspf/ within a GWT framework. I know that
I know that in GWT the java reflection tools isn't emulated, but is there
Does GWT has LazyPanel .I can not see it .Please let me know .If
Does anyone know how to monitor long-running server-side processes in GWT, other than polling
I need to compile my GWT 1.7 project from my ant build file....anyone know
Know this might be rather basic, but I been trying to figure out how
Does anyone know of a GWT widget that works like a spelling suggestor? Ideally
I would like to know the difference between GWT, GWT-RPC, EXT-GWT and Smart GWT.
I wanted to know the GWT equivalent of setTimeout function available in JavaScript? I
Does anyone know a good production scale open source project written with GWT and

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.