Important Notice - Forums is archived
To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
First use the vaadin and have no idea about the AbstractComponentContainer
I am studying the Events with Listeners
public class TheButtons extends CustomComponent implements Button.ClickListener {
Button thebutton;
Button secondbutton;
/** Creates two buttons in given container. */
public TheButtons(AbstractComponentContainer container) {
thebutton = new Button ("Do not push this button");
thebutton.addListener(this);
container.addComponent(thebutton);
secondbutton = new Button ("I am a button too");
secondbutton.addListener(this);
container.addComponent (secondbutton);
}
/** Handle button click events from the two buttons. */
public void buttonClick (Button.ClickEvent event) {
if (event.getButton() == thebutton)
thebutton.setCaption("Do not push this button again");
else if (event.getButton() == secondbutton)
secondbutton.setCaption("I am not a number");
}
}
The next is my application
public class TheButtonsApplication extends Application {
private static final long serialVersionUID = 2255770134219573908L;
@Override
public void init(){
/** Do not know where this is used correctly */
AbstractComponentContainer ac=new CustomComponent();
Window mainWindow=new Window("WindowOpener Application");
mainWindow.addComponent(new TheButtons(ac));
setMainWindow(mainWindow);
}
}
I really do not understand how to use the AbstractComponentContainer