It gets updated in the end because that's where you update it. You need to do the bar.setValue()
(in EDT, like you already correctly do), every time you need to update the bar.
A cleaner approach, perhaps, is using a SwingWorker. Use publish()
when the value has updated. SwingWorkers can coalesce multiple changes to one, and you can ignore all but the last one (like you likely want to do in your case) in process()
.