The problem is, that you do not know in advance how many files you have. Generelly, you have the option to run through the file system twice: the first time, you just enter directories and only count all files.
Based on this number, you can then calculate a percentage on the second run, where you have a look at the files itself.
This obviously enlongates the process and again you do not have a progress on the first scan.
What you can do, is starting the first scan in a different thread. Assuming your pattern matching needs more time than just counting files, the counting will be faster and you can adjust the JProgressBar dynamically. It will then start unreliable and become more accurate over time.
I guess this aproach is similar to the one implemented in the windows copy mechanism. They also scan files first without progress information and then start copying with progress information. However, this may lead to effects you probably know from windows-machines where file operations have information like "2 hours left" and suddenly after 2 minutes it's done, or vice versa.
Edit:
Sorry, I just right now noticed that you want to iterate through all files on a hard drive and not just starting in some point.
You may sum the file size that you have seen already, if you know the free and total disk space, you can compute the percentage that is already done. However, the progress will most likely not be smooth because file sizes tend to be very different.