Allowing the removal of container property

how do make the container allow removing container property?

depends on a container.

the class import
so how would i know?

Where do you get your container from?

As Joonas mentioned, it depends on the container. For example, a BeanItemContainer doesn’t allow the developer to remove properties while an IndexedContainer does. If you have code like this…

Container container = getSomeContainer();

… then check the implementation of getSomeContainer() to see which type of container(s) it returns.

Also, the question is, why do you want to remove a property from a container if it’s added to the container in the first place? I don’t know your use case, but often there is another way of accomplishing whatever you want to do. Quite often you don’t actually want to remove the property, just restrict its visibility. For example, you might have a BeanItemContainer and you’ve assigned it as the data source for a table. Now you’ll propably want to limit which properties are shown in the table. The correct way to do this is to use the table’s
method to define which properties should be visible.