开发者

Add a List<JToogleButton> to a JPanel

开发者 https://www.devze.com 2023-02-28 02:50 出处:网络
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.

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开发者_JS百科, then 1 and so on..).

How to achieve this layout?


You can try placing the JPanel with a FlowLayout in a JScrollPane and add all the buttons.

0

精彩评论

暂无评论...
验证码 换一张
取 消