final Button openButton = new Button("open me");
openButton.addClickListener(new ClickListener() {
@Override
public void buttonClick(final ClickEvent event) {
final Window window = new Window("Simple Window");
window.setModal(true);
window.setHeight("200px");
window.setWidth("200px");
final Table table = new Table();
window.setContent(table);
UI.getCurrent().addWindow(window);
window.addCloseListener(new CloseListener() {
@Override
public void windowClose(final CloseEvent e) {
window.setContent(new Label());
UI.getCurrent().removeWindow(window);
}
});
}
});
addComponent(openButton);
final Button openButton2 = new Button("open me without Table");
openButton2.addClickListener(new ClickListener() {
@Override
public void buttonClick(final ClickEvent event) {
final Window window = new Window("Simple Window");
window.setModal(true);
window.setHeight("200px");
window.setWidth("200px");
UI.getCurrent().addWindow(window);
window.addCloseListener(new CloseListener() {
@Override
public void windowClose(final CloseEvent e) {
UI.getCurrent().removeWindow(window);
}
});