Does anyone know how to keep a GridBagLayout responsive on resize and always show vertical scroll bars? I need to make something that is responsive, for smaller screens (to 1024x640) and include scroll bars. Ive tried different ideas but am missing something here. If possible can someone please take a look at the cut down code and see whats wrong with respect to making it include scrollbars and be responsive. The program needs to be able to resize from 1280x800 to 1024x640 and always include a vertical scroller. The Grid needs to stay responsive to keep everything on the horizontal axis visible (without horizontal scroller) while the vertical scroller needs to do its thing and remain visible.
At the moment when I add scroll bars the Grid full extends, taking away the benefit of using the GridBag.
posted 4 years ago
Answered: Don't forget to set panel.setMaximumSize, and panel.setPreferredSize on the panel being wrapped in the scroller . After adding this everything worked like a treat. I hope this can help someone else out there.
So you made a portal in time and started grabbing people. This tiny ad thinks that's rude: