This example demonstrates the use of the widthZeroIfInvisible and heightZeroIfInvisible flags of an ExplicitConstraints object. These flags control whether the width and height of a component is set to zero when the component is invisible.
The frame below contains buttons labelled 'One' to 'Six' and some check boxes that allow you to change the visibility of some of the components. All buttons except 'Five' have both the widthZeroIfInvisible=true and heightZeroIfInvisible=true. Button five has its widthZeroIfInvisible=false. See source code for details of layout.
Notice the following behaviour:For more sophisticated behaviour when components are made invisible, it is possible to modify the constraints at runtime (see Ratio Trigger example)