Question

I want to develop small project for file copy application in java swing. I want to show progress bar for that, means how much percent data is been copy.. so can any body tell me idea how to develop it

Was it helpful?

Solution

Sure thing. Here is an idea: When you copy files use InputStream and read a standard size of bytes, say 1024 bytes, and copy it to the new file. Each time you read the file, your progress is

(1024 bytes * NumberOfReads)/SizeOfFileInBytes
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top