O'Reilly logo

Vaadin 7 UI Design By Example Beginner's Guide by Alejandro Duarte

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

Time for action – creating a custom component

Have you ever accepted license terms when installing software? Sometimes you can click the Install button only and only if you have previously checked a Yeah right. I do Accept the Terms checkbox. Let's make a custom component to emulate that corporate praised behavior. The steps to create a custom component are as follows:

  1. Create a new Vaadin project with the name customcomponent using your IDE.
  2. Create a new class extending CustomComponent:
    public class AcceptTermsButton extends CustomComponent {
    
    }
  3. We need three components: a CheckBox, a Button, and a VerticalLayout:
    public class AcceptTermsButton extends CustomComponent {
    
      private VerticalLayout layout = new VerticalLayout();
      private CheckBox checkbox ...

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