I have a GUI that has a JScrollPane (scrollPane) and a JPanel (headerPanel) inside another JPanel (mainPanel). I used GridBagConstraints with the GridBagLayout for mainPanel and a FlowLayout for headerPanel. I also weighted the components so scrollPane takes up the unused space of headerPanel. The only problem is that when the Flowlayout moves components in headerPanel to another row (as it should), the GridBagLayout of mainPanel cuts off the additional rows.
So my question, is there a way to have the GridBagLayout accommodate for extra rows of a FlowLayout, when the component with the FlowLayout is weighted less than the other components?
here is my SSCCE:
As you can see, not all of the buttons show up, but if you expand the JFrame window, the buttons move to the first row of the FlowLayout.
Thanks for any help,