summaryrefslogtreecommitdiffstats
path: root/vaadin-app/src/ch/asynk
diff options
context:
space:
mode:
Diffstat (limited to 'vaadin-app/src/ch/asynk')
-rw-r--r--vaadin-app/src/ch/asynk/helloworld/HelloWorldApp.java12
1 files changed, 12 insertions, 0 deletions
diff --git a/vaadin-app/src/ch/asynk/helloworld/HelloWorldApp.java b/vaadin-app/src/ch/asynk/helloworld/HelloWorldApp.java
index 2a85bc4..455cbfb 100644
--- a/vaadin-app/src/ch/asynk/helloworld/HelloWorldApp.java
+++ b/vaadin-app/src/ch/asynk/helloworld/HelloWorldApp.java
@@ -1,8 +1,12 @@
package ch.asynk.helloworld;
+import java.util.Date;
+
import com.vaadin.Application;
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 {
@@ -14,6 +18,14 @@ public class HelloWorldApp extends Application {
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());
+ }
+ }));
+ //
setMainWindow(mainWindow);
}
}