Need to have JProgress bar to measure progress when copying directories and files

后端 未结 3 662
臣服心动
臣服心动 2020-12-18 10:11

I have the below code to copy directories and files but not sure where to measure the progress. Can someone help
as to where can I measure how much has been copied and s

3条回答
  •  Happy的楠姐
    2020-12-18 10:35

    To accomplish this, you have to figure out the number of copy operations in advance. You did not include your copyFolder method, but I assume that you would like to perform a recursive copy. If so, you have to traverse the whole directory tree to figure out how many files you are going to copy. This can get nasty for the user when dealing with large directory structures. (This is why modern operation systems often display an annoying "preparing to copy..." - message before the operation starts and progress is displayed)

提交回复
热议问题