Author Topic:   can you add the same component to more than one container.
shan
unregistered
posted February 19, 2000 07:36 PM           
can you add the same component to more than one container.

a.true
b.false

maha anna
bartender
posted February 19, 2000 08:41 PM             
This is what I found. When you add a SAME COMPONENT to more than 1 container, the LAST ADDED CONTAINER only has this component. It is asthough the component is removed from the old container to the new container. I checked this also.When you add to the first container and check the container.getComponentCount() it is 1.(Assuming this is the only comp it has right now.) Then when you add the same component to another container , the 1st container's container.getcomponent() is reduced by 1 and becomes 0.And when you check container.getComponet() on the 2nd container it is increased by 1.
When you add the SAME comp to the SAME container at diff pos(North/South/East/West) , the LAST ADDED pos has this component. At all times the container's geComponentCount() remains same.(i.e) when you add first time componentCount() is increased by 1 and then onwards it remains same. This is what I tested and found. So the answer for this has MORE YES THAN NO. Others can add to this.
regds
maha anna

[This message has been edited by maha anna (edited February 19, 2000).]

|