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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T08:26:47+00:00 2026-05-26T08:26:47+00:00

My application consists of two class files, let’s call them A and B. A

  • 0

My application consists of two class files, let’s call them A and B. A is the main one – the one which is executed and the main class of the jar file. In A I define a JFrame, to which I add two JPanels: one of them is composed of JButtons and JLabels, and the other one is a graphical one, and is implemented in B (B extends JPanel).

In B I have a method which could take a while, so I wish to give the user information about the process going on there; namely, I’d like to tell the user how much computation is left. I want to do it by updating a JLabel in class A. However, when I try it, I get that the JLabel is updated only after the method had been completed, i.e. instead of seeing it running from 0% to 100% I only see 100%, all the time.

I don’t think I have any relevant pieces of code to show you, but if there’s something you’d want me to post, please do let me know.

I’ve checked similar questions but it appears to me that they asked something quite different.

Thank you,

Ron.

  • 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-26T08:26:47+00:00Added an answer on May 26, 2026 at 8:26 am

    Yours is a threading problem. Your long-running process is tying up the main Swing thread, the EDT, preventing any drawing, updating of components, or user interactions. You need to do the long-running process in a background thread such as one supplied by a SwingWorker object. Do this and your GUI will become much more responsive.

    Check out Concurrency in Swing for more on this important topic.

    If you need more specific help, you will need to supply more information and code.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an application that consists of two processes (let's call them A and
I have an application which consists of two activities/screens and a java class from
My application's main icon consists of two parts in one image: a logo and
I am creating an application, which consists of two static libs and an executable.
My application consists of two part: a web service, which sends queues to a
I have a web application that consists of two websites - one running on
I'm building an application which (currently) consists of one web application (ASP.NET MVC) and
My application consists of two parts: A Windows Service running under the LocalSystem account
An application consists of one or more processes. A process, in the simplest terms,
We are developing an application which consists of: a source code base given to

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.