{"id":39277,"date":"2016-07-19T11:00:21","date_gmt":"2016-07-19T08:00:21","guid":{"rendered":"http:\/\/examples.javacodegeeks.com\/?p=39277"},"modified":"2019-04-09T12:58:45","modified_gmt":"2019-04-09T09:58:45","slug":"vaadin-window-example","status":"publish","type":"post","link":"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/vaadin\/vaadin-window-example\/","title":{"rendered":"Vaadin Window Example"},"content":{"rendered":"<p>A widget container to open, close and move overlay widgets on the screen, is a window.&nbsp;This kind of widget is used to create application dialogs for multiple tasks.<\/p>\n<p>You can have a window blocking the UI (modal window) or a non blocking window (modeless window).&nbsp;The simplest window is an alert notification but you can use this widget to make complex configuration dialogs for your application.<br \/>\n&nbsp;<br \/>\n&nbsp;<br \/>\n&nbsp;<br \/>\n&nbsp;<br \/>\n&nbsp;\n<\/p>\n<div class=\"toc\">\n<h3>Table Of Contents<\/h3>\n<dl>\n<dt><a href=\"#toc100\">1. The tools<\/a><\/dt>\n<dt><a href=\"#toc200\">2. Introduction<\/a><\/dt>\n<dt><a href=\"#toc300\">3. Prerequisites<\/a><\/dt>\n<dt><a href=\"#toc400\">4. Set up the project<\/a><\/dt>\n<dt><a href=\"#toc500\">5. Coding the example<\/a><\/dt>\n<dd>\n<dl>\n<dt><a href=\"#toc510\">5.1 Styles<\/a><\/dt>\n<dd>\n<dl>\n<dt><a href=\"#toc511\">5.1.1 .v-window-contents<\/a><\/dt>\n<dt><a href=\"#toc512\">5.1.2 .v-window-outerheader<\/a><\/dt>\n<dt><a href=\"#toc513\">5.1.3 .v-window-header<\/a><\/dt>\n<dt><a href=\"#toc514\">5.1.4 .v-window-closebox<\/a><\/dt>\n<dt><a href=\"#toc515\">5.1.5 .v-window-maximizebox<\/a><\/dt>\n<dt><a href=\"#toc516\">5.1.6 .v-window-restorebox<\/a><\/dt>\n<\/dl>\n<\/dd>\n<dt><a href=\"#toc520\">5.2 Modeless Window<\/a><\/dt>\n<dd>\n<dl>\n<dt><a href=\"#toc521\">5.2.1 The class<\/a><\/dt>\n<dt><a href=\"#toc522\">5.2.2 Constructor without parameters<\/a><\/dt>\n<dt><a href=\"#toc523\">5.2.3 Constructor with caption parameter<\/a><\/dt>\n<dt><a href=\"#toc524\">5.2.4 The create window method<\/a><\/dt>\n<\/dl>\n<\/dd>\n<dt><a href=\"#toc530\">5.3 Modal Window<\/a><\/dt>\n<dd>\n<dl>\n<dt><a href=\"#toc531\">5.3.1 The class<\/a><\/dt>\n<dt><a href=\"#constructor\">5.3.2 The constructor<\/a><\/dt>\n<\/dl>\n<\/dd>\n<dt><a href=\"#toc540\">5.4 Main Class init method<\/a><\/dt>\n<dd>\n<dl>\n<dt><a href=\"#toc541\">5.4.1 The layout<\/a><\/dt>\n<dt><a href=\"#toc542\">5.4.2 Modeless button<\/a><\/dt>\n<dt><a href=\"#toc543\">5.4.3 Modal button<\/a><\/dt>\n<dt><a href=\"#toc544\">5.4.4 Initial window<\/a><\/dt>\n<\/dl>\n<\/dd>\n<\/dl>\n<\/dd>\n<dt><a href=\"#toc600\">6. The complete source code<\/a><\/dt>\n<dd>\n<dl>\n<dt><a href=\"#toc610\">6.1 Custom Styles<\/a><\/dt>\n<dt><a href=\"#toc620\">6.2 Modal Window<\/a><\/dt>\n<dt><a href=\"#toc630\">6.3 Modeless Window<\/a><\/dt>\n<dt><a href=\"#toc640\">6.4 Main Class<\/a><\/dt>\n<\/dl>\n<\/dd>\n<dt><a href=\"#toc700\">7. Running the example<\/a><\/dt>\n<dt><a href=\"#toc800\">8. Results<\/a><\/dt>\n<dd>\n<dl>\n<dt><a href=\"#toc810\">8.1 Initial Window<\/a><\/dt>\n<dt><a href=\"#toc820\">8.2 Modeless Window<\/a><\/dt>\n<dt><a href=\"#toc830\">8.3 Modal Window<\/a><\/dt>\n<\/dl>\n<\/dd>\n<dt><a href=\"#toc900\">9. Download the Source Code<\/a><\/dt>\n<\/dl>\n<\/div>\n<h2><a name=\"toc100\"><\/a>1. The tools<\/h2>\n<ul>\n<li>Java JDK 8<\/li>\n<li>Latest Eclipse Mars<\/li>\n<li>Vaadin 7.6.7<\/li>\n<li>Tomcat Server 8<\/li>\n<\/ul>\n<h2><a name=\"toc200\"><\/a>2. Introduction<\/h2>\n<p>In this example we are going to create a window when the application starts.&nbsp;We have two buttons to create a modal window and a modeless window when you press each button.<br \/>\nWe change the style of the window to show how to do it.<\/p>\n<h2><a name=\"toc300\"><\/a>3. Prerequisites<\/h2>\n<ul>\n<li>JDK installed<\/li>\n<li>Eclipse Mars installed and working<\/li>\n<li>Vaadin plug-in installed<\/li>\n<li>Tomcat 8 installed and running<\/li>\n<\/ul>\n<h2><a name=\"toc400\"><\/a>4. Set up the project<\/h2>\n<p>In the file menu choose File -&gt; New -&gt; Other<\/p>\n<p><figure id=\"attachment_34378\" aria-describedby=\"caption-attachment-34378\" style=\"width: 646px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/02\/01-New-Project-1.png\" rel=\"attachment wp-att-34378\"><img decoding=\"async\" class=\"size-full wp-image-34378\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/02\/01-New-Project-1.png\" alt=\"01 New Project\" width=\"646\" height=\"422\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/02\/01-New-Project-1.png 646w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/02\/01-New-Project-1-300x196.png 300w\" sizes=\"(max-width: 646px) 100vw, 646px\" \/><\/a><figcaption id=\"caption-attachment-34378\" class=\"wp-caption-text\">1 New Project<\/figcaption><\/figure><\/p>\n<p>Now from the list choose Vaadin 7 project<\/p>\n<p><figure id=\"attachment_34379\" aria-describedby=\"caption-attachment-34379\" style=\"width: 524px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/02\/02-Vaadin-Project-1.png\" rel=\"attachment wp-att-34379\"><img decoding=\"async\" class=\"size-full wp-image-34379\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/02\/02-Vaadin-Project-1.png\" alt=\"02 Vaadin Project\" width=\"524\" height=\"499\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/02\/02-Vaadin-Project-1.png 524w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/02\/02-Vaadin-Project-1-300x286.png 300w\" sizes=\"(max-width: 524px) 100vw, 524px\" \/><\/a><figcaption id=\"caption-attachment-34379\" class=\"wp-caption-text\">2 Vaadin Project<\/figcaption><\/figure><\/p>\n<p>Press&nbsp;next and name your project then click finish.<\/p>\n<h2><a name=\"toc500\"><\/a>5. Coding the example<\/h2>\n<h3><a name=\"toc510\"><\/a>5.1 Styles<\/h3>\n<p>To change the styles, edit the file:<br \/>\n[Project folder]-&gt; WebContent -&gt; VAADIN -&gt; themes -&gt; [Project Name] -&gt; [Project Name].scss<\/p>\n<p><figure id=\"attachment_39279\" aria-describedby=\"caption-attachment-39279\" style=\"width: 269px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/07\/3-Edit-Styles.png\"><img decoding=\"async\" class=\"size-full wp-image-39279\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/07\/3-Edit-Styles.png\" alt=\"3 Edit Styles\" width=\"269\" height=\"567\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/07\/3-Edit-Styles.png 269w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/07\/3-Edit-Styles-142x300.png 142w\" sizes=\"(max-width: 269px) 100vw, 269px\" \/><\/a><figcaption id=\"caption-attachment-39279\" class=\"wp-caption-text\">3 Edit Styles<\/figcaption><\/figure><\/p>\n<p>The window has multiple parts to style.<\/p>\n<h4><a name=\"toc511\"><\/a>5.1.1 .v-window-contents<\/h4>\n<p><code>.v-window-contents<\/code> styles the client area of the window. This is the area where you place your widgets.<\/p>\n<p><span style=\"text-decoration: underline;\"><em>.v-window-contents<\/em><\/span><\/p>\n<pre class=\"brush:java\">\t.v-window-mywindowstyle .v-window-contents {\n\t\tbackground: #EDEC76;\n\t}\n\n<\/pre>\n<p><code>background: #EDEC76;<\/code> changes the background color to a tone of yellow.<\/p>\n<h4><a name=\"toc512\"><\/a>5.1.2 .v-window-outerheader<\/h4>\n<p><code>.v-window-outerheader<\/code> styles the area where you put the window caption.<\/p>\n<p><span style=\"text-decoration: underline;\"><em>.v-window-outerheader<\/em><\/span><\/p>\n<pre class=\"brush:java\">\t.v-window-mywindowstyle .v-window-outerheader {\n\t\tbackground: black;\n\t}\n\n<\/pre>\n<p><code>background: black;<\/code>&nbsp;sets the background color to black.<\/p>\n<h4><a name=\"toc513\"><\/a>5.1.3 .v-window-header<\/h4>\n<p><code>.v-window-header<\/code> Includes the outer header and also the area where the control buttons are placed.<\/p>\n<p><span style=\"text-decoration: underline;\"><em>.v-window-header<\/em><\/span><\/p>\n<pre class=\"brush:java\">\t.v-window-mywindowstyle .v-window-header {\n\t\tcolor: white;\n\t}\n\n<\/pre>\n<p><code>color: white;<\/code>&nbsp;sets the text color to white.<\/p>\n<h4><a name=\"toc514\"><\/a>5.1.4 .v-window-closebox<\/h4>\n<p><code>.v-window-closebox<\/code>&nbsp;is the button to close the window.<\/p>\n<p><span style=\"text-decoration: underline;\"><em>.v-window-closebox<\/em><\/span><\/p>\n<pre class=\"brush:java\">\t.v-window-mywindowstyle .v-window-closebox {\n\t\tbackground: black;\n\t}\n\n<\/pre>\n<p><code>background: black;<\/code>&nbsp;sets the background color to black.<\/p>\n<h4><a name=\"toc515\"><\/a>5.1.5 .v-window-maximizebox<\/h4>\n<p><code>.v-window-maximizebox<\/code>&nbsp;is the button to maximize the window.<\/p>\n<p><span style=\"text-decoration: underline;\"><em>.v-window-maximizebox<\/em><\/span><\/p>\n<pre class=\"brush:java\">\t.v-window-mywindowstyle .v-window-maximizebox {\n\t\tbackground: black;\n\t}\n\n<\/pre>\n<p><code>background: black;<\/code>&nbsp;sets the background color to black.<\/p>\n<h4><a name=\"toc516\"><\/a>5.1.6 .v-window-restorebox<\/h4>\n<p><code>.v-window-restorebox<\/code>&nbsp; is the button to restore the window when is maximized.<\/p>\n<p><span style=\"text-decoration: underline;\"><em>.v-window-restorebox<\/em><\/span><\/p>\n<pre class=\"brush:java\">\t.v-window-mywindowstyle .v-window-restorebox {\n\t\tbackground: black;\n\t}\n\n<\/pre>\n<p><code>background: black;<\/code>&nbsp;sets the background color to black.<div style=\"display:inline-block; margin: 15px 0;\"> <div id=\"adngin-JavaCodeGeeks_incontent_video-0\" style=\"display:inline-block;\"><\/div> <\/div><\/p>\n<h3><a name=\"toc520\"><\/a>5.2 CustomWindow<\/h3>\n<p>This is a window to be opened when the user press the appropriate button.&nbsp;We put this window into its own class and use it from the Vaadin Init method.<\/p>\n<h4><a name=\"toc521\"><\/a>5.2.1 The class<\/h4>\n<p><span style=\"text-decoration: underline;\"><em>The class<\/em><\/span><\/p>\n<pre class=\"brush:java\">public class CustomWindow extends Window\n\n<\/pre>\n<p>We extend this class from Window.<\/p>\n<h4><a name=\"toc522\"><\/a>5.2.2 Constructor without parameters<\/h4>\n<p><span style=\"text-decoration: underline;\"><em>CustomWindow()<\/em><\/span><\/p>\n<pre class=\"brush:java\">\tpublic CustomWindow() {\n\t\tcreateWindow();\n\t}\n\n<\/pre>\n<p>With this constructor we create a window without using any parameters.<\/p>\n<h4><a name=\"toc523\"><\/a>5.2.3 Constructor with caption parameter<\/h4>\n<p><span style=\"text-decoration: underline;\"><em>CustomWindow(String caption)<\/em><\/span><\/p>\n<pre class=\"brush:java\">\tpublic CustomWindow(String caption) {\n\t\tsuper(caption);\n\t\tcreateWindow();\n\t}\n\n<\/pre>\n<p>In this constructor we pass the caption parameter to the super constructor of the class.<\/p>\n<h4><a name=\"toc524\"><\/a>5.2.4 The create window method<\/h4>\n<p><span style=\"text-decoration: underline;\"><em>createWindow()<\/em><\/span><\/p>\n<pre class=\"brush:java\">\tprivate void createWindow(){\n\t\tLabel message = new Label(\"This is a message\");\n\t\tButton close = new Button(\"Close\",FontAwesome.CLOSE);\n\t\tclose.addClickListener(new ClickListener() {\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic void buttonClick(ClickEvent event) {\n\t\t\t\tclose();\n\t\t\t}\n\t\t});\n\t\tVerticalLayout windowContent = new VerticalLayout();\n\t\twindowContent.setMargin(true);\n\t\tsetContent(windowContent);\n\t\twindowContent.addComponent(message);\n\t\twindowContent.addComponent(close);\n\t\tsetPosition(20, 150);\n\t\tsetWidth(\"250px\");\n\t\tsetHeight(\"150px\");\n\t\tsetClosable(false);\n\t\taddStyleName(\"mywindowstyle\");\n\t\t\n\t}\n\n<\/pre>\n<p><code>Label message = new Label(\"This is a message\");<\/code> Creates a label to be placed into the window.<br \/>\n<code>Button close = new Button(\"Close\",FontAwesome.CLOSE);<\/code> Creates a button to close the window.<\/p>\n<p><code>close.addClickListener(new ClickListener()<\/code> Adds a click listener to the button.<br \/>\n<code>close();<\/code> When the close button is pressed this closes the window.<\/p>\n<p><code>VerticalLayout windowContent = new VerticalLayout();<\/code> Creates a layout for the window.<br \/>\n<code>windowContent.setMargin(true);<\/code> Sets the margin of the layout.<\/p>\n<p><code>setContent(windowContent);<\/code> Sets the content of the window to use the layot.<br \/>\n<code>windowContent.addComponent(message);<\/code> Adds the label message to the layout.<\/p>\n<p><code>windowContent.addComponent(close);<\/code> Adds the button to the layout.<br \/>\n<code>setPosition(20, 150);<\/code> Sets the position of the window in pixels.<\/p>\n<p><code>setWidth(\"250px\");<\/code> Sets the width of the window in pixels.<br \/>\n<code>setHeight(\"150px\");<\/code> Sets the height of the window in pixels.<\/p>\n<p><code>setClosable(false);<\/code> Disables the upper right close button of the window<br \/>\n<code>addStyleName(\"mywindowstyle\");<\/code> Adds the styles to the window.<\/p>\n<h3><a name=\"toc530\"><\/a>5.3 ModalWindow<\/h3>\n<p>This is a modal window that blocks the UI when is displayed.<\/p>\n<h4><a name=\"toc531\"><\/a>5.3.1 The class<\/h4>\n<p><span style=\"text-decoration: underline;\"><em>The class<\/em><\/span><\/p>\n<pre class=\"brush:java\">public class ModalWindow extends Window\n\n<\/pre>\n<p>We extends the class from the window superclass.<\/p>\n<h4><a name=\"toc532\"><\/a>5.3.2 The constructor<\/h4>\n<p>We only have one constructor here. Into this constructor we create our modal window.<br \/>\nThis constructor gets no parameters.<\/p>\n<p><span style=\"text-decoration: underline;\"><em>ModalWindow()<\/em><\/span><\/p>\n<pre class=\"brush:java\">\tpublic ModalWindow() {\n\t\tsuper(\"Modal Window\");\n\t\tLabel message = new Label(\"This is a Modal Window\");\n\t\tButton close = new Button(\"Close\",FontAwesome.CLOSE);\n\t\tclose.addClickListener(new ClickListener() {\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic void buttonClick(ClickEvent event) {\n\t\t\t\tclose();\n\t\t\t}\n\t\t});\n\t\tVerticalLayout windowContent = new VerticalLayout();\n\t\twindowContent.setMargin(true);\n\t\tsetContent(windowContent);\n\t\twindowContent.addComponent(message);\n\t\twindowContent.addComponent(close);\n\t\tsetPosition(20, 150);\n\t\tsetWidth(\"250px\");\n\t\tsetHeight(\"150px\");\n\t\taddStyleName(\"mywindowstyle\");\n\t\tsetModal(true);\n\t}\n\n<\/pre>\n<p><code>super(\"Modal Window\");<\/code> Sets the caption of the window using the superclass.<br \/>\n<code>Label message = new Label(\"This is a Modal Window\");<\/code> Creates a label.<\/p>\n<p><code>Button close = new Button(\"Close\",FontAwesome.CLOSE);<\/code> Creates the close button.<br \/>\n<code>close.addClickListener(new ClickListener()<\/code> Adds a click listener to the button.<\/p>\n<p><code>close();<\/code> When the click listener is called, it closes the window.<br \/>\n<code>VerticalLayout windowContent = new VerticalLayout();<\/code> Creates a layout for the window.<\/p>\n<p><code>windowContent.setMargin(true);<\/code> Sets the margin of the layout.<br \/>\n<code>setContent(windowContent);<\/code> Sets the content of the window to the layout.<\/p>\n<p><code>windowContent.addComponent(message);<\/code> Adds the label to the layout.<br \/>\n<code>windowContent.addComponent(close);<\/code> Adds the button to the layout.<\/p>\n<p><code>setPosition(20, 150);<\/code> Sets the position of the window.<br \/>\n<code>setWidth(\"250px\");<\/code> Sets the width of the window.<\/p>\n<p><code>setHeight(\"150px\");<\/code> Sets the height of the window.<br \/>\n<code>addStyleName(\"mywindowstyle\");<\/code> Adds a style to the window.<\/p>\n<p><code>setModal(true);<\/code> Sets the modal property of the window.<\/p>\n<h3><a name=\"toc540\"><\/a>5.4 Main Class init method<\/h3>\n<h4><a name=\"toc541\"><\/a>5.4.1 The layout<\/h4>\n<p>we create the layout of our application.<\/p>\n<p><span style=\"text-decoration: underline;\"><em>Layout<\/em><\/span><\/p>\n<pre class=\"brush:java\">\t\tfinal HorizontalLayout layout = new HorizontalLayout();\n\t\tlayout.setMargin(true);\n\t\tlayout.setSpacing(true);\n\t\tsetContent(layout);\n<\/pre>\n<p><code>final HorizontalLayout layout = new HorizontalLayout();<\/code> Creates the main layout.<br \/>\n<code>layout.setMargin(true);<\/code> Sets the margin of the main layout.<\/p>\n<p><code>layout.setSpacing(true);<\/code> Sets the spacing of the main layout.<br \/>\n<code>setContent(layout);<\/code> Sets the content of the application to the layout.<\/p>\n<h4><a name=\"toc542\"><\/a>5.4.2 Modeless button<\/h4>\n<p>Creates a button to show the modeless window<\/p>\n<p><span style=\"text-decoration: underline;\"><em>Modeless button<\/em><\/span><\/p>\n<pre class=\"brush:java\">\t\tButton bModelessWindow = new Button(\"Modeless Window\");\n\t\tbModelessWindow.addClickListener(new Button.ClickListener() {\n\t\t\tpublic void buttonClick(ClickEvent event) {\n\t\t\t\tCustomWindow customWindow = new CustomWindow(\"Custom Window\");\n\t\t\t\taddWindow(customWindow);\n\t\t\t}\n\t\t});\n\t\tlayout.addComponent(bModelessWindow);\n\n<\/pre>\n<p><code>Button bModelessWindow = new Button(\"Modeless Window\");<\/code> Creates a button to show the modeless window.<br \/>\n<code>bModelessWindow.addClickListener(new Button.ClickListener()<\/code> Adds a click listener to the button.<\/p>\n<p><code>CustomWindow customWindow = new CustomWindow(\"Custom Window\");<\/code> Creates a custom window.<br \/>\n<code>addWindow(customWindow);<\/code> Adds the window to the UI.[ulp id=&#8217;YBvYYzEYBUrADqmI&#8217;]<\/p>\n<p><code>layout.addComponent(bModelessWindow);<\/code> Adds the button to the layout.<\/p>\n<h4><a name=\"toc543\"><\/a>5.4.3 Modal button<\/h4>\n<p>Creates a button to show the modal window<\/p>\n<p><span style=\"text-decoration: underline;\"><em>Modal button<\/em><\/span><\/p>\n<pre class=\"brush:java\">\t\tButton bModalWindow = new Button(\"Modal Window\");\n\t\tbModalWindow.addClickListener(new Button.ClickListener() {\n\t\t\tpublic void buttonClick(ClickEvent event) {\n\t\t\t\tModalWindow modalWindow = new ModalWindow();\n\t\t\t\taddWindow(modalWindow);\n\t\t\t}\n\t\t});\n\t\tlayout.addComponent(bModalWindow);\n\n<\/pre>\n<p><code>Button bModalWindow = new Button(\"Modal Window\");<\/code> Creates a button to show the modal window.<br \/>\n<code>bModalWindow.addClickListener(new Button.ClickListener()<\/code> Adds a click listener to the button.<\/p>\n<p><code>ModalWindow modalWindow = new ModalWindow();<\/code> Creates a new nodal window.<br \/>\n<code>addWindow(modalWindow);<\/code> Adds the window to the UI.<\/p>\n<p><code>layout.addComponent(bModalWindow);<\/code> Adds the button to the layout.<\/p>\n<h4><a name=\"toc544\"><\/a>5.4.4 Initial window<\/h4>\n<p>We create a window when we launch our application.<\/p>\n<p><span style=\"text-decoration: underline;\"><em>Initial window<\/em><\/span><\/p>\n<pre class=\"brush:java\">\t\tWindow myWindow = new Window(\"My Window\");\n\t\tVerticalLayout windowContent = new VerticalLayout();\n\t\twindowContent.setMargin(true);\n\t\tmyWindow.setContent(windowContent);\n\t\tmyWindow.setWidth(\"250px\");\n\t\twindowContent.addComponent(new Label(\"This is a window\"));\n\t\tmyWindow.center();\n\t\tmyWindow.addStyleName(\"mywindowstyle\");\n\t\taddWindow(myWindow);\n\n<\/pre>\n<p><code>Window myWindow = new Window(\"My Window\");<\/code> Creates a window.<br \/>\n<code>VerticalLayout windowContent = new VerticalLayout();<\/code> Creates a layout for the initial window.<\/p>\n<p><code>windowContent.setMargin(true);<\/code> Sets the margin of the layout of the window.<br \/>\n<code>myWindow.setContent(windowContent);<\/code> Sets the content of the window to the layout.<\/p>\n<p><code>myWindow.setWidth(\"250px\");<\/code> Sets the width of the window.<br \/>\n<code>windowContent.addComponent(new Label(\"This is a window\"));<\/code> Creates a label to show inside the window.<\/p>\n<p><code>myWindow.center();<\/code> Center the window on the screen.<br \/>\n<code>myWindow.addStyleName(\"mywindowstyle\");<\/code> Add the style to the window.<\/p>\n<p><code>addWindow(myWindow);<\/code> Add the window to the UI.<\/p>\n<h2><a name=\"toc600\"><\/a>6. The complete source code<\/h2>\n<h3><a name=\"toc610\"><\/a>6.1 Custom Styles<\/h3>\n<p><span style=\"text-decoration: underline;\"><em>vaadinwindow.scss<\/em><\/span><\/p>\n<pre class=\"brush:java\">@import \"..\/valo\/valo.scss\";\n\n@mixin vaadinwindow {\n  @include valo;\n\n\t.v-window-mywindowstyle .v-window-contents {\n\t\tbackground: #EDEC76;\n\t}\n\n\t.v-window-mywindowstyle .v-window-outerheader {\n\t\tbackground: black;\n\t} \n\n\t.v-window-mywindowstyle .v-window-header {\n\t\tcolor: white;\n\t}\n\n\t.v-window-mywindowstyle .v-window-closebox {\n\t\tbackground: black;\n\t}\n\n\t.v-window-mywindowstyle .v-window-maximizebox {\n\t\tbackground: black;\n\t}\n\n\t.v-window-mywindowstyle .v-window-restorebox {\n\t\tbackground: black;\n\t}\n\n}\n<\/pre>\n<h3><a name=\"toc620\"><\/a>6.2 Modal Window<\/h3>\n<p><span style=\"text-decoration: underline;\"><em>ModalWindow.java<\/em><\/span><\/p>\n<pre class=\"brush:java\">package com.example.vaadinwindow;\n\nimport com.vaadin.server.FontAwesome;\nimport com.vaadin.ui.Button;\nimport com.vaadin.ui.Button.ClickEvent;\nimport com.vaadin.ui.Button.ClickListener;\nimport com.vaadin.ui.Label;\nimport com.vaadin.ui.VerticalLayout;\nimport com.vaadin.ui.Window;\n\n@SuppressWarnings(\"serial\")\npublic class ModalWindow extends Window {\n\n\tpublic ModalWindow() {\n\t\tsuper(\"Modal Window\");\n\t\tLabel message = new Label(\"This is a Modal Window\");\n\t\tButton close = new Button(\"Close\",FontAwesome.CLOSE);\n\t\tclose.addClickListener(new ClickListener() {\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic void buttonClick(ClickEvent event) {\n\t\t\t\tclose();\n\t\t\t}\n\t\t});\n\t\tVerticalLayout windowContent = new VerticalLayout();\n\t\twindowContent.setMargin(true);\n\t\tsetContent(windowContent);\n\t\twindowContent.addComponent(message);\n\t\twindowContent.addComponent(close);\n\t\tsetPosition(20, 150);\n\t\tsetWidth(\"250px\");\n\t\tsetHeight(\"150px\");\n\t\taddStyleName(\"mywindowstyle\");\n\t\tsetModal(true);\n\t}\n\n}\n<\/pre>\n<h3><a name=\"toc630\"><\/a>6.3 Modeless Window<\/h3>\n<p><span style=\"text-decoration: underline;\"><em>CustomWindow.java<\/em><\/span><\/p>\n<pre class=\"brush:java\">package com.example.vaadinwindow;\n\nimport com.vaadin.server.FontAwesome;\nimport com.vaadin.ui.Button;\nimport com.vaadin.ui.Button.ClickEvent;\nimport com.vaadin.ui.Button.ClickListener;\nimport com.vaadin.ui.Label;\nimport com.vaadin.ui.VerticalLayout;\nimport com.vaadin.ui.Window;\n\n@SuppressWarnings(\"serial\")\npublic class CustomWindow extends Window {\n\n\tpublic CustomWindow() {\n\t\tcreateWindow();\n\t}\n\n\tpublic CustomWindow(String caption) {\n\t\tsuper(caption);\n\t\tcreateWindow();\n\t}\n\t\n\tprivate void createWindow(){\n\t\tLabel message = new Label(\"This is a message\");\n\t\tButton close = new Button(\"Close\",FontAwesome.CLOSE);\n\t\tclose.addClickListener(new ClickListener() {\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic void buttonClick(ClickEvent event) {\n\t\t\t\tclose();\n\t\t\t}\n\t\t});\n\t\tVerticalLayout windowContent = new VerticalLayout();\n\t\twindowContent.setMargin(true);\n\t\tsetContent(windowContent);\n\t\twindowContent.addComponent(message);\n\t\twindowContent.addComponent(close);\n\t\tsetPosition(20, 150);\n\t\tsetWidth(\"250px\");\n\t\tsetHeight(\"150px\");\n\t\tsetClosable(false);\n\t\taddStyleName(\"mywindowstyle\");\n\t\t\n\t}\n\n}\n<\/pre>\n<h3><a name=\"toc640\"><\/a>6.4 Main Class<\/h3>\n<p><span style=\"text-decoration: underline;\"><em>VaadinwindowUI.java<\/em><\/span><\/p>\n<pre class=\"brush:java\">package com.example.vaadinwindow;\n\nimport javax.servlet.annotation.WebServlet;\n\nimport com.vaadin.annotations.Theme;\nimport com.vaadin.annotations.VaadinServletConfiguration;\nimport com.vaadin.server.VaadinRequest;\nimport com.vaadin.server.VaadinServlet;\nimport com.vaadin.ui.Button;\nimport com.vaadin.ui.Button.ClickEvent;\nimport com.vaadin.ui.HorizontalLayout;\nimport com.vaadin.ui.Label;\nimport com.vaadin.ui.UI;\nimport com.vaadin.ui.VerticalLayout;\nimport com.vaadin.ui.Window;\n\n@SuppressWarnings(\"serial\")\n@Theme(\"vaadinwindow\")\npublic class VaadinwindowUI extends UI {\n\n\t@WebServlet(value = \"\/*\", asyncSupported = true)\n\t@VaadinServletConfiguration(productionMode = false, ui = VaadinwindowUI.class, widgetset = \"com.example.vaadinwindow.widgetset.VaadinwindowWidgetset\")\n\tpublic static class Servlet extends VaadinServlet {\n\t}\n\n\t@Override\n\tprotected void init(VaadinRequest request) {\n\t\t\n\t\tfinal HorizontalLayout layout = new HorizontalLayout();\n\t\tlayout.setMargin(true);\n\t\tlayout.setSpacing(true);\n\t\tsetContent(layout);\n\n\t\tButton bModelessWindow = new Button(\"Modeless Window\");\n\t\tbModelessWindow.addClickListener(new Button.ClickListener() {\n\t\t\tpublic void buttonClick(ClickEvent event) {\n\t\t\t\tCustomWindow customWindow = new CustomWindow(\"Custom Window\");\n\t\t\t\taddWindow(customWindow);\n\t\t\t}\n\t\t});\n\t\tlayout.addComponent(bModelessWindow);\n\t\t\n\t\tButton bModalWindow = new Button(\"Modal Window\");\n\t\tbModalWindow.addClickListener(new Button.ClickListener() {\n\t\t\tpublic void buttonClick(ClickEvent event) {\n\t\t\t\tModalWindow modalWindow = new ModalWindow();\n\t\t\t\taddWindow(modalWindow);\n\t\t\t}\n\t\t});\n\t\tlayout.addComponent(bModalWindow);\n\t\t\n\t\tWindow myWindow = new Window(\"My Window\");\n\t\tVerticalLayout windowContent = new VerticalLayout();\n\t\twindowContent.setMargin(true);\n\t\tmyWindow.setContent(windowContent);\n\t\tmyWindow.setWidth(\"250px\");\n\t\twindowContent.addComponent(new Label(\"This is a window\"));\n\t\tmyWindow.center();\n\t\tmyWindow.addStyleName(\"mywindowstyle\");\n\t\taddWindow(myWindow);\n\t\t\n\t}\n\n}\n<\/pre>\n<h2><a name=\"toc700\"><\/a>7. Running the example<\/h2>\n<p>Right click on the project folder and choose Run as -&gt; Run on server choose Tomcat 8 server and click finish.<\/p>\n<h2><a name=\"toc800\"><\/a>8. Results<\/h2>\n<h3><a name=\"toc810\"><\/a>8.1 Initial Window<\/h3>\n<p>This is the initial window when you launch the application<\/p>\n<p><figure id=\"attachment_39280\" aria-describedby=\"caption-attachment-39280\" style=\"width: 545px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/07\/4-Initial-window.png\"><img decoding=\"async\" class=\"size-full wp-image-39280\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/07\/4-Initial-window.png\" alt=\"4 Initial window\" width=\"545\" height=\"364\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/07\/4-Initial-window.png 545w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/07\/4-Initial-window-300x200.png 300w\" sizes=\"(max-width: 545px) 100vw, 545px\" \/><\/a><figcaption id=\"caption-attachment-39280\" class=\"wp-caption-text\">4 Initial window<\/figcaption><\/figure><\/p>\n<h3><a name=\"toc820\"><\/a>8.2 Modeless Window<\/h3>\n<p>This is the modeless window launched when we press the button.<\/p>\n<p><figure id=\"attachment_39281\" aria-describedby=\"caption-attachment-39281\" style=\"width: 547px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/07\/5-Modeless-window.png\"><img decoding=\"async\" class=\"size-full wp-image-39281\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/07\/5-Modeless-window.png\" alt=\"5 Modeless window\" width=\"547\" height=\"365\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/07\/5-Modeless-window.png 547w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/07\/5-Modeless-window-300x200.png 300w\" sizes=\"(max-width: 547px) 100vw, 547px\" \/><\/a><figcaption id=\"caption-attachment-39281\" class=\"wp-caption-text\">5 Modeless window<\/figcaption><\/figure><\/p>\n<h3><a name=\"toc830\"><\/a>8.3 Modal Window<\/h3>\n<p>This is the modal window. When we show this window, other parts of the UI are blocked.<\/p>\n<p><figure id=\"attachment_39282\" aria-describedby=\"caption-attachment-39282\" style=\"width: 542px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/07\/6-Modal-window.png\"><img decoding=\"async\" class=\"size-full wp-image-39282\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/07\/6-Modal-window.png\" alt=\"6 Modal window\" width=\"542\" height=\"361\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/07\/6-Modal-window.png 542w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/07\/6-Modal-window-300x200.png 300w\" sizes=\"(max-width: 542px) 100vw, 542px\" \/><\/a><figcaption id=\"caption-attachment-39282\" class=\"wp-caption-text\">6 Modal window<\/figcaption><\/figure><\/p>\n<h2><a name=\"toc900\"><\/a>9. Download the Source Code<\/h2>\n<p>This was an example of: Vaadin Window.<\/p>\n<div class=\"download\"><strong>Download<\/strong><br \/>\nYou can download the Eclipse project here:&nbsp;<strong><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/07\/VaadinWindow.zip\">VaadinWindow<\/a><br \/>\n<\/strong><\/div>\n","protected":false},"excerpt":{"rendered":"<p>A widget container to open, close and move overlay widgets on the screen, is a window.&nbsp;This kind of widget is used to create application dialogs for multiple tasks. You can have a window blocking the UI (modal window) or a non blocking window (modeless window).&nbsp;The simplest window is an alert notification but you can use &hellip;<\/p>\n","protected":false},"author":77,"featured_media":33079,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1358],"tags":[1265],"class_list":["post-39277","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-vaadin","tag-vaadin"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Vaadin Window Example - Java Code Geeks<\/title>\n<meta name=\"description\" content=\"A widget container to open, close and move overlay widgets on the screen, is a window.&nbsp;This kind of widget is used to create application dialogs for\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/vaadin\/vaadin-window-example\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Vaadin Window Example - Java Code Geeks\" \/>\n<meta property=\"og:description\" content=\"A widget container to open, close and move overlay widgets on the screen, is a window.&nbsp;This kind of widget is used to create application dialogs for\" \/>\n<meta property=\"og:url\" content=\"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/vaadin\/vaadin-window-example\/\" \/>\n<meta property=\"og:site_name\" content=\"Examples Java Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/javacodegeeks\" \/>\n<meta property=\"article:published_time\" content=\"2016-07-19T08:00:21+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-04-09T09:58:45+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/01\/vaadin-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Jesus Boadas\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@jboadas\" \/>\n<meta name=\"twitter:site\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Jesus Boadas\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"10 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/vaadin\/vaadin-window-example\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/vaadin\/vaadin-window-example\/\"},\"author\":{\"name\":\"Jesus Boadas\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/506f9c2b38156c7f94bba77757206dd7\"},\"headline\":\"Vaadin Window Example\",\"datePublished\":\"2016-07-19T08:00:21+00:00\",\"dateModified\":\"2019-04-09T09:58:45+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/vaadin\/vaadin-window-example\/\"},\"wordCount\":1125,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/vaadin\/vaadin-window-example\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/01\/vaadin-logo.jpg\",\"keywords\":[\"Vaadin\"],\"articleSection\":[\"Vaadin\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/vaadin\/vaadin-window-example\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/vaadin\/vaadin-window-example\/\",\"url\":\"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/vaadin\/vaadin-window-example\/\",\"name\":\"Vaadin Window Example - Java Code Geeks\",\"isPartOf\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/vaadin\/vaadin-window-example\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/vaadin\/vaadin-window-example\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/01\/vaadin-logo.jpg\",\"datePublished\":\"2016-07-19T08:00:21+00:00\",\"dateModified\":\"2019-04-09T09:58:45+00:00\",\"description\":\"A widget container to open, close and move overlay widgets on the screen, is a window.&nbsp;This kind of widget is used to create application dialogs for\",\"breadcrumb\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/vaadin\/vaadin-window-example\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/vaadin\/vaadin-window-example\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/vaadin\/vaadin-window-example\/#primaryimage\",\"url\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/01\/vaadin-logo.jpg\",\"contentUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/01\/vaadin-logo.jpg\",\"width\":150,\"height\":150},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/vaadin\/vaadin-window-example\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/examples.javacodegeeks.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Java Development\",\"item\":\"https:\/\/examples.javacodegeeks.com\/category\/java-development\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Enterprise Java\",\"item\":\"https:\/\/examples.javacodegeeks.com\/category\/java-development\/enterprise-java\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Vaadin\",\"item\":\"https:\/\/examples.javacodegeeks.com\/category\/java-development\/enterprise-java\/vaadin\/\"},{\"@type\":\"ListItem\",\"position\":5,\"name\":\"Vaadin Window Example\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#website\",\"url\":\"https:\/\/examples.javacodegeeks.com\/\",\"name\":\"Java Code Geeks\",\"description\":\"Java Examples and Code Snippets\",\"publisher\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#organization\"},\"alternateName\":\"JCG\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/examples.javacodegeeks.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\/\/examples.javacodegeeks.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"contentUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/javacodegeeks\",\"https:\/\/x.com\/javacodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/506f9c2b38156c7f94bba77757206dd7\",\"name\":\"Jesus Boadas\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/10\/Jesus-Boadas_avatar_1476120926-96x96.jpg\",\"contentUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/10\/Jesus-Boadas_avatar_1476120926-96x96.jpg\",\"caption\":\"Jesus Boadas\"},\"description\":\"I'm a self taught programmer, I began programming back in 1991 using an IBM A10 mainframe with Pascal an Assembler IBM 360\/70 emulator and Turbo C on a X86 PC, since that I work for the banking industry with emerging technologies like Fox Pro, Visual Fox Pro, Visual Basic, Visual C++, Borland C++, lately I moved out to the Airline industry, leading designing and programming in-house web applications with Flex, Actionscript, PHP, Python and Rails and in the last 7 years I focused all my work in Java, working on Linux servers using GlassFish, TomCat, Apache and MySql.\",\"sameAs\":[\"http:\/\/www.javacodegeeks.com\/\",\"https:\/\/ve.linkedin.com\/in\/jesus-boadas\",\"https:\/\/x.com\/jboadas\"],\"url\":\"https:\/\/examples.javacodegeeks.com\/author\/jesus-boadas\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Vaadin Window Example - Java Code Geeks","description":"A widget container to open, close and move overlay widgets on the screen, is a window.&nbsp;This kind of widget is used to create application dialogs for","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/vaadin\/vaadin-window-example\/","og_locale":"en_US","og_type":"article","og_title":"Vaadin Window Example - Java Code Geeks","og_description":"A widget container to open, close and move overlay widgets on the screen, is a window.&nbsp;This kind of widget is used to create application dialogs for","og_url":"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/vaadin\/vaadin-window-example\/","og_site_name":"Examples Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_published_time":"2016-07-19T08:00:21+00:00","article_modified_time":"2019-04-09T09:58:45+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/01\/vaadin-logo.jpg","type":"image\/jpeg"}],"author":"Jesus Boadas","twitter_card":"summary_large_image","twitter_creator":"@jboadas","twitter_site":"@javacodegeeks","twitter_misc":{"Written by":"Jesus Boadas","Est. reading time":"10 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/vaadin\/vaadin-window-example\/#article","isPartOf":{"@id":"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/vaadin\/vaadin-window-example\/"},"author":{"name":"Jesus Boadas","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/506f9c2b38156c7f94bba77757206dd7"},"headline":"Vaadin Window Example","datePublished":"2016-07-19T08:00:21+00:00","dateModified":"2019-04-09T09:58:45+00:00","mainEntityOfPage":{"@id":"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/vaadin\/vaadin-window-example\/"},"wordCount":1125,"commentCount":0,"publisher":{"@id":"https:\/\/examples.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/vaadin\/vaadin-window-example\/#primaryimage"},"thumbnailUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/01\/vaadin-logo.jpg","keywords":["Vaadin"],"articleSection":["Vaadin"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/vaadin\/vaadin-window-example\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/vaadin\/vaadin-window-example\/","url":"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/vaadin\/vaadin-window-example\/","name":"Vaadin Window Example - Java Code Geeks","isPartOf":{"@id":"https:\/\/examples.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/vaadin\/vaadin-window-example\/#primaryimage"},"image":{"@id":"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/vaadin\/vaadin-window-example\/#primaryimage"},"thumbnailUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/01\/vaadin-logo.jpg","datePublished":"2016-07-19T08:00:21+00:00","dateModified":"2019-04-09T09:58:45+00:00","description":"A widget container to open, close and move overlay widgets on the screen, is a window.&nbsp;This kind of widget is used to create application dialogs for","breadcrumb":{"@id":"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/vaadin\/vaadin-window-example\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/vaadin\/vaadin-window-example\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/vaadin\/vaadin-window-example\/#primaryimage","url":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/01\/vaadin-logo.jpg","contentUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/01\/vaadin-logo.jpg","width":150,"height":150},{"@type":"BreadcrumbList","@id":"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/vaadin\/vaadin-window-example\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/examples.javacodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"Java Development","item":"https:\/\/examples.javacodegeeks.com\/category\/java-development\/"},{"@type":"ListItem","position":3,"name":"Enterprise Java","item":"https:\/\/examples.javacodegeeks.com\/category\/java-development\/enterprise-java\/"},{"@type":"ListItem","position":4,"name":"Vaadin","item":"https:\/\/examples.javacodegeeks.com\/category\/java-development\/enterprise-java\/vaadin\/"},{"@type":"ListItem","position":5,"name":"Vaadin Window Example"}]},{"@type":"WebSite","@id":"https:\/\/examples.javacodegeeks.com\/#website","url":"https:\/\/examples.javacodegeeks.com\/","name":"Java Code Geeks","description":"Java Examples and Code Snippets","publisher":{"@id":"https:\/\/examples.javacodegeeks.com\/#organization"},"alternateName":"JCG","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/examples.javacodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/examples.javacodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/examples.javacodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/javacodegeeks","https:\/\/x.com\/javacodegeeks"]},{"@type":"Person","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/506f9c2b38156c7f94bba77757206dd7","name":"Jesus Boadas","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/image\/","url":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/10\/Jesus-Boadas_avatar_1476120926-96x96.jpg","contentUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/10\/Jesus-Boadas_avatar_1476120926-96x96.jpg","caption":"Jesus Boadas"},"description":"I'm a self taught programmer, I began programming back in 1991 using an IBM A10 mainframe with Pascal an Assembler IBM 360\/70 emulator and Turbo C on a X86 PC, since that I work for the banking industry with emerging technologies like Fox Pro, Visual Fox Pro, Visual Basic, Visual C++, Borland C++, lately I moved out to the Airline industry, leading designing and programming in-house web applications with Flex, Actionscript, PHP, Python and Rails and in the last 7 years I focused all my work in Java, working on Linux servers using GlassFish, TomCat, Apache and MySql.","sameAs":["http:\/\/www.javacodegeeks.com\/","https:\/\/ve.linkedin.com\/in\/jesus-boadas","https:\/\/x.com\/jboadas"],"url":"https:\/\/examples.javacodegeeks.com\/author\/jesus-boadas\/"}]}},"_links":{"self":[{"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/39277","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/users\/77"}],"replies":[{"embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/comments?post=39277"}],"version-history":[{"count":0,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/39277\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/media\/33079"}],"wp:attachment":[{"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/media?parent=39277"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=39277"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=39277"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}