diff options
Diffstat (limited to 'java-vaadin/src/ch/asynk/helloworld/EndLayout.java')
-rw-r--r-- | java-vaadin/src/ch/asynk/helloworld/EndLayout.java | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/java-vaadin/src/ch/asynk/helloworld/EndLayout.java b/java-vaadin/src/ch/asynk/helloworld/EndLayout.java new file mode 100644 index 0000000..2b5c15f --- /dev/null +++ b/java-vaadin/src/ch/asynk/helloworld/EndLayout.java @@ -0,0 +1,31 @@ +package ch.asynk.helloworld; + +import com.vaadin.ui.VerticalLayout; +import com.vaadin.ui.Label; +import com.vaadin.ui.Button; +import com.vaadin.ui.Button.ClickEvent; + +public class EndLayout extends VerticalLayout { + // + private static final long serialVersionUID = 1L; + // + private Context ctx = null; + + public EndLayout(Context context) { + ctx = context; + // + final Label lb1 = new Label(); + lb1.setCaption("That's all folks"); + addComponent(lb1); + // + Button closeButton = new Button("close the application"); + closeButton.setDescription("This will close the application"); + addComponent(closeButton ); + closeButton.addListener( new Button.ClickListener() { + @Override + public void buttonClick(ClickEvent event) { + getApplication().getMainWindow().getApplication().close(); + } + }); + } +}; |