@Override
public void buttonClick(ClickEvent event) {
int components = Integer.parseInt(n.getValue());
Layout layout = getCurrentLayout();
for (int i = 0; i < components; i++) {
Component component = newTestComponent();
if (cb.getValue()) {
component.setCaption("caption " + i);
}
layout.addComponent(component);
}
testarea.removeAllComponents();