Reputation: 177
I am trying to organize my over all program to have a BorderLayout(NORTH EAST SOUTH WEST CENTER), mainly just to utilize the north center and south aspects. I am in the process of creating flow panels to go into each part of the layout, but they are not stacking correctly, instead they are just lining up from left to right. My code is as follows.
JPanel SortingSouth = new JPanel(new FlowLayout(FlowLayout.LEFT, 10, 10));
SortingSouth.add(DocumentLabel);
SortingSouth.add(Document);
Sorting.add(SortingNorth, BorderLayout.NORTH);
Sorting.add(SortingSouth, BorderLayout.SOUTH);
Sorting is my overall Panel to contain the other 3 panels I intend to create, and is set up with a border layout. I guess my question is why is my border layout not working when I give it a flow layout to one of its containers? (I know this is just a short snippet of my code, but the rest is just declaring what the labels are, etc, my SortingNorth is structured the same)
Upvotes: 1
Views: 77
Reputation: 1329
Have you tried this?
JPanel sorting = new JPanel(new BorderLayout());
(Also, try not to write you variables with the first letter in uppercase)
Upvotes: 1