Frage

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

War es hilfreich?

Lösung

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
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top