I don't see where you've actually displayed the JProgressBar on the screen.
If you look at the loop where you set the values of the progress bar, it's actually going to run very quickly -- perhaps so quickly that you'll never actually see it updated. It's true that you call setVisible(), setLocation(), and setSize() 10,000 times (I'm not clear why -- shouldn't these be outside the loop?) but I suspect the implementations are smart enough to not actually do anything if they're called with the same values twice in succession.
Instead of running 10,000 times, you might want to run 100 times, and sleep for 10 ms at each step, to give the event queue a chance to catch up.
In any case, this isn't advanced
Java. We have a Swing/AWT forum for this kind of question, so I'll move this
thread there for you.