Kristopher Ives
Kristopher Ives

Reputation: 6025

Vertical Stacking like GTK in Java Swing?

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.

Upvotes: 0

Views: 290

Answers (3)

Taisin
Taisin

Reputation: 491

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

Upvotes: 1

sateesh
sateesh

Reputation: 28683

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

Upvotes: 1

erickson
erickson

Reputation: 269687

A vertical BoxLayout should be easiest.

Upvotes: 7

Related Questions