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. ...

Get Vaadin 7 UI Design By Example Beginner's Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.