如何在加载后对 Vaadin 组件进行运行时更改

How to make runtime changes to a Vaadin component after loading

如何在页面从另一个 Vaadin 页面导航到后使用计时器动态更改 Vaadin h1 元素?

导航

start.addClickListener(e->{
    ActorCallsHandler.ach.startGame();
    UI.getCurrent().navigate(Playboard.class);
});

class

public class Playboard extends VerticalLayout
{
    private H1 timer;

    public Playboard() throws ExecutionException, InterruptedException{
        generateGUI();
    }

    private void generateGUI(){
      //h1 element that should alter using a timer after page load
      H1 timer = new H1(); 
    }
}

为此,您需要使用 Vaadin 的推送或轮询功能,以便可以随时将更改发送到客户端,而不是仅在对某些用户操作触发的请求的响应中发送.

我建议您在 https://vaadin.com/docs/v13/flow/advanced/tutorial-push-configuration.html 查看推送功能的文档。