I would like to create a simple notircation - I’ve copied the code from the example, but no matter what I do, the notification shows up on the bottom of the page - and the user the user does not even know it exists unless they scroll to it. And then - it’s formatted rather strange…
private void notifyUser(String msg) {
log.info(“notify users with msg:{}”, msg);
Notification notification = new Notification();
Div text = new Div(new Text(msg));Button closeButton = new Button(new Icon("lumo", "cross")); closeButton.addThemeVariants(ButtonVariant.LUMO_TERTIARY_INLINE); closeButton.setAriaLabel("Close"); closeButton.addClickListener(event -> { notification.close(); }); notification.setPosition(Notification.Position.MIDDLE); notification.addThemeVariants(NotificationVariant.LUMO_CONTRAST); notification.add(text, closeButton); notification.open(); return; }