Your problem is that you’re creating a BoxLayout
for a JFrame
(this
), but setting it as the layout for a JPanel
(getContentPane()
). Try:
getContentPane().setLayout(
new BoxLayout(getContentPane(), BoxLayout.PAGE_AXIS)
);
Your problem is that you’re creating a BoxLayout
for a JFrame
(this
), but setting it as the layout for a JPanel
(getContentPane()
). Try:
getContentPane().setLayout(
new BoxLayout(getContentPane(), BoxLayout.PAGE_AXIS)
);