I currently have a program which reads from a text file and then writes to a database after each line it reads, the size of the text file is undetermined, some days the file could be more or less lines than other days.
I already have a swing worker that executes my functions so my progress bar works but right now I just have setIndeterminate to true so the user knows something is being done just not the actual progress.
Is there a way I can increment the progress bar after each line is read, but have it not reach 100 too early or too late, preferably without reading the the text file entirely before hand. Thanks, Beef.
I’d use File.length() to determine the file size. Then keep track of the number of bytes read to determine the progress.