-2

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

Paul Lo
  • 6,032
  • 6
  • 31
  • 36
Vicky3D
  • 173
  • 3
  • 13
  • 2
    You need to show your attempt first – Paul Lo Dec 12 '13 at 10:39
  • Please read: http://meta.stackexchange.com/questions/182266/how-much-research-effort-is-expected-of-stack-overflow-users – Crozin Dec 12 '13 at 10:40
  • You could take a look at [this](http://stackoverflow.com/questions/13394898/how-create-progress-bar-while-file-transfering/13395076#13395076) and [this](http://stackoverflow.com/questions/13574461/need-to-have-jprogress-bar-to-measure-progress-when-copying-directories-and-file/13574755#13574755) for some ideas – MadProgrammer Dec 12 '13 at 11:20

1 Answers1

0

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
dARKpRINCE
  • 1,538
  • 2
  • 13
  • 22