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 8873177
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T18:23:59+00:00 2026-06-14T18:23:59+00:00

I am trying to port a .NET app over into java and need an

  • 0

I am trying to port a .NET app over into java and need an asynchronous downloader that increments a progress bar once a download (or asynchronous task) completes, similar to .NET’s WebClient and its DownloadFileCompleted event. The app will be waiting for the downloads to complete, but I don’t want the UI to lock up over the course of the downloads with “Not Responding”. The problem lies in the inability of the download thread to directly increment the progress bar, since it was created in the main thread. I was thinking, since this is a SWT app (which has an os message pump loop), that I could somehow pump a message from the download thread and let the main thread pick it up. Is this possible? Is there another way?

  • 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-06-14T18:24:00+00:00Added an answer on June 14, 2026 at 6:24 pm

    try to use Display.asyncExec to update progress bar value from download thread.

    Display.getCurrent().asyncExec(new Runnable() {         
            @Override
            public void run() {
            // update progress bar value here
            }
    
    });
    

    I’m not sure to have understood, but maybe something like this can run:

    class Downloader {
        public static void downloadAsync(Object object, String url, final ProgressBar progressBar ){
                // download thread
            new Thread(new Runnable() {
                @Override
                public void run() {
                    // start download here
                    // while download progresses
                    Display.getDefault().asyncExec(new Runnable() {
                        @Override
                        public void run() {
                            progressBar.setSelection(<your progress value>);
                        }
                    });
                }
            });
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I’m working on trying to port an ASP.NET app from Server 2003 (and IIS6)
I'm currently trying to port an app from asp.net to php, however I just
I am trying to port some code form java do F# that generates a
I am currently trying to port a .Net app to Objective C and Cocoa.
I am trying to figure out how to port some .Net code that parsed
I'm trying to set the port on a cookie in ASP.NET (code below), but
I am trying to port some of my WebDriver tests from JAVA to C#.
Im trying to make a small app in c++ that saves midifiles with this
Got that error when trying to push updated app to Heroku (probably the same
I'm trying to write a basic console app that will send an email. The

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.