Yes, but you'll need to update the progress bar from the context of the thread, other wise you'll be blocking the a Event Dispatching Thread (EDT). This will mean you will need to synchronise the update with the EDT using something SwingUtilities.invokeLater.
Take a closer look at Concurrency in Swing for more details
You could also take a look at the indeterminate state of the progress bar, which can be used to indicate work in progress when you don't know how much work needs to be done
You could also use a SwingWorker
which progress support via it's PropertyChange
support