I have a JPanel with BoxLayout.PAGE_AXIS, but when I add two JLabels to it, the first fills the whole JPanel. PreferredSize for JPanel is height 10. Both JLabels have preferred height 5, and width is same for all three.
What am I doing wrong?
P.S. That’s why I preffer the freaking null layout…
Try this code, it should work fine: