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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T10:15:20+00:00 2026-05-20T10:15:20+00:00

First off I’ve been working with Java’s Concurrency package quite a bit lately but

  • 0

First off I’ve been working with Java’s Concurrency package quite a bit lately but I have found an issue that I am stuck on. I want to have and Application and the Application can have a SplashScreen with a status bar and the loading of other data. So I decided to use SwingUtilities.invokeAndWait( call the splash component here ). The SplashScreen then appears with a JProgressBar and runs a group of threads. But I can’t seem to get a good handle on things. I’ve looked over SwingWorker and tried using it for this purpose but the thread just returns. Here is a bit of pseudo code. and the points I’m trying to achieve.

  • Have an Application that has a SplashScreen that pauses while loading info
  • Be able to run multiple threads under the SplashScreen
  • Have the progress bar of the SplashScreen Update-able yet not exit until all threads are done.

Launching splash screen

try {
    SwingUtilities.invokeAndWait( SplashScreen );
} catch (InterruptedException e) {
} catch (InvocationTargetException e) { }

Splash screen construction

SplashScreen extends JFrame implements Runnable{

    public void run() {
        //run threads
        //while updating status bar
    }
}

I have tried many things including SwingWorkers, Threads using CountDownLatch’s, and others. The CountDownLatch’s actually worked in the manner I wanted to do the processing but I was unable to update the GUI. When using the SwingWorkers either the invokeAndWait was basically nullified (which is their purpose) or it wouldn’t update the GUI still even when using a PropertyChangedListener. If someone else has a couple ideas it would be great to hear them. Thanks in advance.

I actually got ready to post better code to help out and found my solution. I thank you for all who helped.

  • 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-20T10:15:20+00:00Added an answer on May 20, 2026 at 10:15 am

    No need to call the frame inside invokeAndWait but you should update progress bar state like this.

    try {
       SwingUtilities.invokeAndWait( new Runnable() {
         public void run() {
    //update state of the progress bar here
         }
       });
     } catch (InterruptedException e) {
     } catch (InvocationTargetException e) { }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

First off I have sort of been tossed off in the deep end on
First off, there's a bit of background to this issue available on my blog:
First off, let me clarify the platforms we are using. We have an ASP.NET
First off, let me start by saying that I am totally new to working
First off, I am not a DBA, but I do work in an environment
First off, I'm aware this is a bad practice and I have answered many
First off, thank you to everyone on this site...it's been INCREDIBLY helpful in getting
First off, I did look on google and stackoverflow, but nothing seem to really
first off this is a class assignment so i would appreciate help but just
First off, I will say i've spent 6 hours on this topic and have

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.