Extending VerticalLayout

The following snippet of code shows a typical way of extending VerticalLayout to implement a UI component, in this case, the login form:

public class LoginFormLayout extends VerticalLayout {

    private TextField username = new PasswordField();
    private PasswordField password = new PasswordField();
    private Button logIn = new Button();
    private CheckBox rememberMe = new CheckBox();
 
    public LoginFormLayout() {
        ...
        addComponents(username, password, logIn, rememberMe);
    }
    ...
}

The logic to handle events and additional UI configuration that might be required is omitted in the previous example.

The full implementation of the LoginFormLayout class is located in the Data-centric-Applications-with-Vaadin-8/chapter-03 Maven project of the source code that accompanies this book.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset