MigLayout
treats invisible components by default the same way as visible components. You need to specify hidemode
for other kind of behaviour. From the documentation, the possible values are:
- Default. Means that invisible components will be handled exactly as if they were visible.
- The size of the component (if invisible) will be set to 0, 0.
- The size of the component (if invisible) will be set to 0, 0 and the gaps will also be set to 0 around it.
- Invisible components will not participate in the layout at all and it will for instance not take up a grid cell.