I have a List<JToggleButton> and I need to add all those buttons to a panel.
The panel needs to have only a vertical scrollbar. It has a fixed size of 600 x 600 px.
Buttons have different sizes and I need them look pretty compact (for example, some rows can have two big buttons, some four smaller). I need to add the buttons by order from list (first with index 0, then 1 and so on..).
How to achieve this layout?
You can try placing the
JPanelwith aFlowLayoutin aJScrollPaneand add all the buttons.