Exception below given when adding a panel to another, then later removing, then adding again in a separate instance of the application:
I believe this to be because although the reference in the parent panel is removed, the parent is not removed from the child, and the check performed before throwing this error is panel.getParent()!=null
java.lang.IllegalArgumentException: cannot add component to multiple containers or twice to the same container
at thinwire.ui.AbstractContainer$ChildList.add(AbstractContainer.java:84)
at thinwire.ui.AbstractContainer$ChildList.add(AbstractContainer.java:42)
at java.util.AbstractList.add(Unknown Source)
at thinwire.apps.tester.Main$1.propertyChange(Main.java:124)
at thinwire.ui.EventListenerImpl.fireEvent(EventListenerImpl.java:310)
at thinwire.ui.EventListenerImpl.firePropertyChange(EventListenerImpl.java:231)
at thinwire.ui.AbstractComponent.firePropertyChange(AbstractComponent.java:135)
at thinwire.ui.Tree$Item.setSelected(Tree.java:189)
at thinwire.render.web.TreeRenderer.componentChange(TreeRenderer.java:149)
at thinwire.render.web.EventProcessor.processUserActionEvent(EventProcessor.java:132)
at thinwire.render.web.EventProcessor.run(EventProcessor.java:88)
This was posted by myself, I have since realised this was a programming error in my application - I was sharing the child panel by using an enum with it as one of the members and not creating a new one for each instance of the application. As a result this had the effect of the panel being added twice to the same parent panel.