O'Reilly logo

Vaadin 7 Cookbook by Ondrej Kvasnovsky, Jaroslav Holan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating a simple form

When we need to pass data from the user to the server, we use input fields. When we have more fields, we arrange them into forms. Creating forms in Vaadin is very easy. In this recipe, we will create a simple login form panel as shown in the following screenshot:

Creating a simple form

How to do it...

Carry out the following steps to create a simple login form:

  1. We create a Vaadin project with a main UI class named Demo.
    public class Demo extends UI {…}
  2. Our form will be wrapped in the Panel container. Therefore, we create a LoginFormPanel class that extends the Panel class.
    public class LoginFormPanel extends Panel {…}
  3. All the parts of the form lie in ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required