Label doesnt update until event finishes

Ok, so i have a program where i manage elevators, the thing is that i have a label that tells in which floor is the elevator actually, but it doesnt work as expected. I have an observer in my main program that should update the label every time the elevator changes floor but it only changes at the end of the event execution i dont know why, causing to pass from 1 to 5 without showing intermediate steps, but taking the time for doing them (i have delays for every time elevator changes floor).
Thanks.

You did not share code details, but based on your description it sounds like you need to enable push by adding @Push in your main layout and possibly modify your code elsewhere too. Without Push the updates to UI are performed only at the time next browser request is made (synchronous). If UI updates are needed in between (asynchronous) Push is needed. There is comprehensive training video with exercise example here:

https://vaadin.com/learn/training/v14-push