Solved

ProgressBar

Posted on 2001-06-04
5
286 Views
Last Modified: 2012-05-04
Hi
I have a problem in my current application(Works as application and applet also).
 
What it does basically is it sends a command to VB through Perl script and waits for the resultimage. As soon as it finds the image in the path it fetches that and shows that on screen.

Main thread waits and second thread waits and gets the image and as soon as it gets the image it notifies the main thread.
But now I want to show a ProgressBar while it is waitng for the image, but the problem is as the Main thread is waiting, the progressBar(Or even any animated gif) is not working. It is just showing the empty window.

Do you have any ideas...solutions????

Thanks in Advance
Samisrini
0
Comment
Question by:Samisrini
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 

Expert Comment

by:JDay
ID: 6153929
Have you tried useing a progress bar?


       // Create a new JProgressBar
        METER_bar = new JProgressBar(0, 100);
JDay
0
 
LVL 92

Expert Comment

by:objects
ID: 6154324
Can we see the code handling the progress bar pls.
0
 

Expert Comment

by:JDay
ID: 6156036

I have extended JDialog and added the progress bar to a panel. This is a method I use to display the meter.
This works for JBuilder 4. What are you useing to build your java program?


JProgressBar METER_bar = new JProgressBar(0, 100);

Use a method to display status bar and percentage complete

    public void Display(int total, int amount)
    {
        // Make the frame visible
        this.setVisible(true);

        // If incorrect value is passed in, return
        if ((total == 0) || (amount > total))
            return;

        // Set METER_total equal to total passed in
        if (total != METER_total)
            METER_total = total;

        // Set METER_amount to amount arg passed in
        METER_amount = amount;

        // Call Draw() to update progress bar
        Draw();

        METER_bar.repaint();
    }



JDAY
0
 
LVL 5

Expert Comment

by:vemul
ID: 7752078
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

- To be PAQ'ed and points NOT refunded

Please leave any comments here within the
next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER !

vemul
Cleanup Volunteer
0
 

Accepted Solution

by:
Banath earned 0 total points
ID: 7842697
Per recommendation - PAQ'ed and points NOT refunded

Banath
EE Moderator
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…

617 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question