Thank you so much, Darryl Burke, that was perfect
Thanks to all the others, too.
There are still a couple of problems though.
This is what I did:
mainPane: GridLayout(NumberOfItems + extraSpace, 1 column).
BuildingPane: BoxLayout(BuildingPane, BoxLayout.X_AXIS)
details about extraSpace are found in the code. It's much neater and very well commented now, so it should be easy to understand.
Here is how it looks now:
It also works when I put in more than one, but I think I really need to use scrollbars.
and place that outer panel in a JScrollPane which is added to the frame.
That is exactly what I am trying to do. I have tried setting mainPane to a JScrollPane instead of a JPanel,
and then I set the layout to a ScrollPaneLayout() instead of a GridLayout().
But when I run the program, I just get this:
This is the first time I am using scrolling. Should I try to use a JScrollBar instead of scrollPane?
I don't want to mess up my layouts just to add a scrollbar
Here is all the code, as it was when I took the first screenshot: http://pastebin.com/yMd7L16B