use of com.vaadin.flow.component.html.Paragraph in project flow by vaadin.
the class PushView method onAttach.
@Override
protected void onAttach(AttachEvent attachEvent) {
super.onAttach(attachEvent);
UI ui = attachEvent.getUI();
// Fallback transport is forced to websocket so that we either get a
// websocket connection or no push connection at all
ui.getPushConfiguration().setFallbackTransport(Transport.WEBSOCKET);
add(new NativeButton("Say hello", e -> {
add(new Paragraph("Hello"));
new Thread(new SayWorld(ui)).start();
}));
}
Aggregations