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 – a tedious application

Follow these steps to create a tedious to use application:

  1. Create a new Vaadin project. We are using shortcut as project name.
  2. Code your UI class:
    public class ShortcutUI extends UI {
    
      protected void init(VaadinRequest request) {
        final VerticalLayout layout = new VerticalLayout();
        layout.setMargin(true);
        layout.setSpacing(true);
        setContent(layout);
    
        final TextField tf = new TextField("Your data:");
        layout.addComponent(tf);
    
        Button button = new Button("Send data (ENTER)");
    
        button.addClickListener(new Button.ClickListener() {
          public void buttonClick(ClickEvent event) {
            layout.addComponent(new Label(tf.getValue()));
            tf.setValue("");
          }
        });
    
        layout.addComponent(button);
      }
    
    }
  3. Run the application and try to send many data. ...

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