package ch.asynk.helloworld; import java.util.Date; import com.vaadin.Application; import com.vaadin.terminal.UserError; import com.vaadin.ui.Window; import com.vaadin.ui.Label; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; public class HelloWorldApp extends Application { private static final long serialVersionUID = 1L; @Override public void init() { final Window mainWindow = new Window("Hello World Application"); Label label = new Label("Hello world"); mainWindow.addComponent(label); // mainWindow.addComponent( new Button("What is the time?", new Button.ClickListener() { @Override public void buttonClick(ClickEvent event) { mainWindow.showNotification("The time is " + new Date()); event.getButton().setComponentError( new UserError("Stop pressing this button !!") ); } })); // setMainWindow(mainWindow); } }