I am not too experienced with Java and it is difficult for me to get a progress bar. I use the built-in graphical user Netbeans. Currently, my program is reading images from a directory into an image array. Obviously, this takes a little time, so I would like a simple progress indicator to update the user to see how busy he is. I used one of those drag and drop components.
-I currently you can get the number of files in a directory and calculate the percentage of downloaded files. Files are successfully loaded into the array, but the progress bar is only updated after all files have been downloaded. I tried reinstalling and repainting while I loop, but it doesnโt work -I tried various docs.oracle tutorials, but it seemed like nothing could get it working. -I believe SwingWorker is a class that I should use, is this correct?
Any help with an example or some tips would be greatly appreciated! Thank!
source
share