I’ve been trying for ages to get a list of JPanels to stack vertically without spreading out to all available vertical space.
The container is a JPanel with a BoxLayout
Here is what is happening and what I want:
https://i.stack.imgur.com/bmJgj.png
I’ve tried using Box.Filler, Box.createGlue(), adjusting alignment properties (they seem to be pretty much useless). Each item calls setAlignmentY(Component.TOP_ALIGNMENT);
Still doesn’t work.
Anyone got a solution?
Put the
BoxLayoutat thePAGE_STARTof aBorderLayout.