简体   繁体   中英

JProgresbar doesn't work with Files.copy

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM