JProgressBar while file copying

Reply

Join Date: Mar 2005
Posts: 25
Reputation: Black Knight is an unknown quantity at this point 
Solved Threads: 0
Black Knight's Avatar
Black Knight Black Knight is offline Offline
Light Poster

JProgressBar while file copying

 
0
  #1
Apr 19th, 2005
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?
Reply With Quote Quick reply to this message  
Join Date: Nov 2004
Posts: 6,145
Reputation: jwenting is just really nice jwenting is just really nice jwenting is just really nice jwenting is just really nice 
Solved Threads: 212
Team Colleague
jwenting's Avatar
jwenting jwenting is offline Offline
duckman

Re: JProgressBar while file copying

 
0
  #2
Apr 19th, 2005
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).
As people are clearly allowed to attack me but I'm not allowed to defend myself, I no longer post to this site.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Java Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC