I want to create a list of SwipeableContainers in a boxlayout on codenameone.
list.add(createWidget("Banana")).
add(createWidget("Apple")).
add(createWidget("Juice"));
public SwipeableContainer createWidget(String info) {
MultiButton button = new MultiButton(info);
return new SwipeableContainer(FlowLayout.encloseCenterMiddle(deleteb),button);
}
Doing this returns an error "java.lang.IllegalArgumentException: Component is already contained in Container: Container[x=0 y=0 width=0 height=0 name=null, layout = FlowLayout, scrollableX = false, scrollableY = false, components = [MultiButton]]." This is the same syntax as used on the Codenameone tutorial provided at: https://www.codenameone.com/javadoc/com/codename1/ui/SwipeableContainer.html. However my code doesn't seem to allow me to create multiple of these components.