Skip to content

Instantly share code, notes, and snippets.

@LiamJolly
Created November 8, 2021 14:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save LiamJolly/28706066a79ec8984654f302c9ef85bb to your computer and use it in GitHub Desktop.
Save LiamJolly/28706066a79ec8984654f302c9ef85bb to your computer and use it in GitHub Desktop.
package com.overliambitious.vaadin.frontend;
import com.vaadin.flow.component.button.Button;
import com.vaadin.flow.component.html.Label;
import com.vaadin.flow.component.notification.Notification;
import com.vaadin.flow.component.orderedlayout.VerticalLayout;
import com.vaadin.flow.router.Route;
import javax.annotation.PostConstruct;
@Route("")
public class MainView extends VerticalLayout {
@PostConstruct
public void init() {
Notification notification = new Notification("Hello!", 3000);
Label label = new Label("Hello World!");
Button button = new Button("Click here!", click -> notification.open());
add(notification);
add(label);
add(button);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment