I want to use JPanels as top-down containers, like DIV tags when creating a web page? If I use BorderLayout, can I only have two (NORTH and SOUTH)?
I want to place different JButtons , JLabels and JTextFields in each JPanels. This is the layout I'm trying to do:
Container1 and its contents
Container2 and its contents
Container3 and its contents
Thanks for the help.
EDIT: I added some part of my code. I'm not sure if I am doing it right?
JPanel container1, container2, container3; container1 = new JPanel(); container2 = new JPanel(); container3 = new JPanel(); container1.setLayout(new BoxLayout(container1, BoxLayout.Y_AXIS)); container2.setLayout(new BoxLayout(container2, BoxLayout.Y_AXIS)); container3.setLayout(new BoxLayout(container3, BoxLayout.Y_AXIS));
source share