Sorry Oliver I’ve been very busy and didn’t see your answer
this is the main class
[color=#002aff]
package com.example.pruebas02;
import java.util.Date;
import com.example.pruebas02.screenMain;
import com.vaadin.Application;
import com.vaadin.ui.*;
import com.vaadin.ui.Button.ClickEvent;
@SuppressWarnings(“serial”)
public class Pruebas02Application extends Application {
public Window mainWindow;
public Window pantalla;
@Override
public void init() {
mainWindow = new Window(“Pruebas02 Application”);
Label label = new Label(“Hello user”);
mainWindow.addComponent(label);
setMainWindow(mainWindow);
pantalla = new Window(“Prb”,new screenMain());
//mainWindow.addComponent(pantalla);
Button boton = new Button(“New Screen”,this,“PruebaBoton”);
mainWindow.addComponent(boton);
setMainWindow(mainWindow);
}
public void PruebaBoton(ClickEvent event) {
// TODO Auto-generated method stub
//mainWindow = new Window("myNewCustomComponent ", new screenMain());
//setMainWindow(mainWindow);
setMainWindow(pantalla);
}
}
[/color]
and here is the windows class I want to tun from the button
[color=#002aff]
package com.example.pruebas02;
import com.vaadin.annotations.AutoGenerated;
import com.vaadin.ui.AbsoluteLayout;
import com.vaadin.ui.Button;
import com.vaadin.ui.CustomComponent;
import com.vaadin.ui.MenuBar;
@SuppressWarnings(“serial”)
public class screenMain extends CustomComponent {
@AutoGenerated
private AbsoluteLayout mainLayout;
@AutoGenerated
private MenuBar menuBar_1;
@AutoGenerated
private Button button_1;
/*- VaadinEditorProperties={"grid":"RegularGrid,20","showGrid":true,"snapToGrid":true,"snapToObject":true,"movingGuides":false,"snappingDistance":10} */
/*- VaadinEditorProperties={"grid":"RegularGrid,20","showGrid":true,"snapToGrid":true,"snapToObject":true,"movingGuides":false,"snappingDistance":10} */
/*- VaadinEditorProperties={"grid":"RegularGrid,20","showGrid":true,"snapToGrid":true,"snapToObject":true,"movingGuides":false,"snappingDistance":10} */
/*- VaadinEditorProperties={"grid":"RegularGrid,20","showGrid":true,"snapToGrid":true,"snapToObject":true,"movingGuides":false,"snappingDistance":10} */
/**
* The constructor should first build the main layout, set the
* composition root and then do any custom initialization.
*
* The constructor will not be automatically regenerated by the
* visual editor.
*/
public screenMain() {
buildMainLayout();
setCompositionRoot(mainLayout);
// TODO add user code here
}
public AbsoluteLayout handle(){
return mainLayout;
}
@AutoGenerated
private AbsoluteLayout buildMainLayout() {
// common part: create layout
mainLayout = new AbsoluteLayout();
mainLayout.setImmediate(false);
mainLayout.setWidth("100%");
mainLayout.setHeight("100%");
mainLayout.setMargin(false);
// top-level component properties
setWidth("100.0%");
setHeight("100.0%");
// button_1
button_1 = new Button();
button_1.setCaption("Button");
button_1.setImmediate(true);
button_1.setWidth("-1px");
button_1.setHeight("-1px");
mainLayout.addComponent(button_1, "top:74.0px;left:40.0px;");
// menuBar_1
menuBar_1 = new MenuBar();
menuBar_1.setImmediate(false);
menuBar_1.setWidth("240px");
menuBar_1.setHeight("-1px");
mainLayout.addComponent(menuBar_1, "top:0.0px;left:20.0px;");
return mainLayout;
}
}
[/color]