JProgresbar doesn't work with Files.copy

偶尔善良 提交于 2019-12-11 10:54:20

问题


I am writing a program that creates a folder for each file in a specific folder. After that the file is copied in the, just created, folder. Everything works, except the JProgressbar I want to add to the program. I also added a Jtextarea but after a file is copied i want to change the progress bar, and add some text to the JTextarea. while the program runs nothing appears but when the whole task is completed all of the text I want in the JTextArea is shown and the progress bar is 100%. I don't know what i did wrong.


回答1:


After the examples that MadProgrammer gave me. I figured out how it worked. You need to update your progresbar in the Swingworker and all the Methodes you want to call, you need to call them in the SwingworkerMethod.



来源:https://stackoverflow.com/questions/31407422/jprogresbar-doesnt-work-with-files-copy

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!