To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.
It will never work the way you do it. Vaadin is running your code until the end before refreshing screen. So you always wait 3 to 10 seconds then see final result in your label. You should use some callbacks.
Some leads : - https://vaadin.com/blog/-/blogs/no-more-waiting-vaadin-7-1-is-here-with-asynchronous-push - https://vaadin.com/docs/-/part/framework/components/components-progressbar.html