| | |
JProgressBar while file copying
![]() |
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?
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
- MS Batch File Copying (Legacy and Other Languages)
- New member with a system file problem... (Windows NT / 2000 / XP)
- copying in files (C++)
- W32.Welchia.Worm (Windows NT / 2000 / XP)
- Windows 2000 Debug file (Windows NT / 2000 / XP)
Other Threads in the Java Forum
- Previous Thread: Accessing Images in JAR file
- Next Thread: Can't think of anything to write...
| Thread Tools | Search this Thread |
android api applet application apps array arrays automation awt bidirectional binary birt bluetooth businessintelligence busy_handler(null) card class classes client code collision columns component constructor crashcourse database designadrawingapplicationusingjavajslider draw eclipse error errors eventlistener exception expand fractal game givemetehcodez graphics gui guidancer html ide image inetaddress integer intellij j2me java javadoc javafx javamicroeditionuseofmotionsensor javaprojects jme jni jpanel jtree julia linux list loop machine map method methods mobile mobiledevelopmentcreatejar myaggfun netbeans newbie oracle physics plazmic print problem program programming project recursion scanner server set sharepoint smart sms smsspam sort sortedmaps sql string subclass support swing textfield threads tree trolltech unlimited utility webservices windows






