开发者

Vertical Stacking like GTK in Java Swing?

开发者 https://www.devze.com 2022-12-20 15:12 出处:网络
I want to stack JComponents vertically, similar to a JList, but since the amount 开发者_运维百科of items is very low and I want a highly custom interface - I wanted to try a vertically stacked set of

I want to stack JComponents vertically, similar to a JList, but since the amount 开发者_运维百科of items is very low and I want a highly custom interface - I wanted to try a vertically stacked set of components.


A vertical BoxLayout should be easiest.


You can try using GridBagLayout manager and tweak the GridBagConstraints properties (gridy and gridx attributes) to achieve the needed result.


BoxLayout(panel, BoxLayout.Y_AXIS), GridLayout(0, 1), and if really needed GridBagLayout

0

精彩评论

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