If there is not enough space, GBL will switch from preferredSize to minimumSize, so if you set a very small minimum size for less important components, GBL will work for you. You can also add the Listener component and simply rebuild the GUI by manually removing the components, or simply switch to a different view.
You could even create a βminiβ view button in the GUI that would automatically resize to the smallest possible size, but retain a reasonable size instead of having users face their own breaches in a carefully thought-out design :)
source share