Right, I have an app that basically copies images from a digi camera to the hdd, the user logs in and then it copies the images accross to the hdd and creates some thumbs and brings up a screen which has the thumbs so they can select what they want on an intranet and which ones to discard.

What I need to have is a JProgressBar which shows the file copying progress. I have managed to get this to work using Runnable interface etc but it goes of as you would expect in its own thread and then the screen that shows the thumbs comes up without waiting for it to finish, thus it doesnt have the thumbs to show. How can i get the main screen to wait for the file uploading to finish before it shows?? I have tried the tread wait() and notify() stuff but it just gives me 'not thread owner' problems.

It works exactly how i want if i dont use threads but then the progress bar does repaint until its done, shoul di put the progress bar in a seperate thread an not the file copying? how could i achieve this. How can i spawn of a progress bar in its own thread to but mainpulated by the main thread which is doing the task?

12 Years
Discussion Span
Last Post by jwenting

try to join the main program thread on the thread running the upload window.
That will block that window (but remember it's messy, the main screen won't be repainted either for example).

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.