I’m searching for a Java layoutmanager which is able to automatically hide (less important) elements, defined by me, if the user scales down the window size.
For example an icon in a row of a label and a JTextField, which is only there to visually enhance the form. If the user resizes the window to a minimum size, the icon should disappear to give the remaining space to the label and the textfield.
Regards
If there is not enough space GBL will switch from preferredSize to minimumSize so possibly if you set a very small minimumSize for the less important components GBL will work for you. You could also add a componentListener and just rebuild the GUI by manually removing components or just switching into another view.
You could even build a ‘mini’ view button into the GUI that would automatically resize to smallest possible but maintain a sensible size instead of users having to faff around on their own breaking stuff in your carefully planned design 🙂