Solved

ProgressBar

Posted on 2001-06-04
5
282 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
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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
recursion example 16 124
jar file executable 12 51
reverse digits of a number using for loop 5 40
eclipse buid path vs tomcat lib path 10 22
For customizing the look of your lightweight component and making it look opaque like it was made of plastic.  This tip assumes your component to be of rectangular shape and completely opaque.   (CODE)
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…

815 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now