Vaadin Flow Basics

All Changes to the Code will be done in the file ListView.java in the package com.example.application.views.list.

src/main/java/com/example/application/views/list/ListView.java

Exercise 1.1

    public ListView() {

        // Display Welcome Message
        add(new H1("Welcome to Our CRM Application"));

    }

Exercise 1.2


    public ListView() {

        // Display Welcome Message
        add(new H1("Welcome to Our CRM Application"));

        Button button = new Button("Click me");

        add(button);

    }

Exercise 1.3

    public ListView() {

        // Display Welcome Message
        add(new H1("Welcome to Our CRM Application"));

        Button button = new Button("Click me");
        TextField name = new TextField("Your name");

        add(name, button);

    }

Exercise 1.4

        // Display Welcome Message
        add(new H1("Welcome to Our CRM Application"));

        Button button = new Button("Click me");
        TextField name = new TextField("Your name");

        // Horizontal Layout
        HorizontalLayout hl = new HorizontalLayout(name, button);

        add(hl);

Exercise 1.5

        // Horizontal Layout
        HorizontalLayout hl = new HorizontalLayout(name, button);
        hl.setDefaultVerticalComponentAlignment(Alignment.BASELINE);

Exercise 1.6

button.addClickListener(click -> Notification.show("Hello " + name.getValue()));

Last updated

Was this helpful?