944,052 Members | Top Members by Rank

Ad:
  • Java Discussion Thread
  • Unsolved
  • Views: 4411
  • Java RSS
Apr 19th, 2005
0

JProgressBar while file copying

Expand Post »
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?
Similar Threads
Reputation Points: 10
Solved Threads: 0
Light Poster
Black Knight is offline Offline
25 posts
since Mar 2005
Apr 19th, 2005
0

Re: JProgressBar while file copying

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).
Team Colleague
Reputation Points: 1658
Solved Threads: 331
duckman
jwenting is offline Offline
7,719 posts
since Nov 2004

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Java Forum Timeline: Accessing Images in JAR file
Next Thread in Java Forum Timeline: Can't think of anything to write...





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC