Solved

ProgressBar

Posted on 2001-06-04
5
279 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
Comment Utility
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
Comment Utility
Can we see the code handling the progress bar pls.
0
 

Expert Comment

by:JDay
Comment Utility

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
Comment Utility
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
Comment Utility
Per recommendation - PAQ'ed and points NOT refunded

Banath
EE Moderator
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
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…
This video teaches viewers about errors in exception handling.

743 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

11 Experts available now in Live!

Get 1:1 Help Now