Depends on what the behaviour should be when the window is resized. But you won't avoid building a tree structure with JPanels.
The top component can have BorderLayout, with one panel in the North and main panel in Center.
The North panel will have X-axis BoxLayout and contain two panels.
Both these panels should have Y-axis BoxLayout and the first one will contain A, C, F and the second one B, D, E.
You should also set preferred sizes for A B C D E and F so that they render with appropriate size.
EDIT:
Here, I created an example:
public class GladysPanel extends JPanel
{
public GladysPanel(JComponent A, JComponent B, JComponent C, JComponent D, JComponent E, JComponent F, JComponent main){
super(new BorderLayout());
JPanel abcdef = new JPanel(new BorderLayout());
Box ab = new Box(BoxLayout.X_AXIS);
ab.add(A);
ab.add(B);
abcdef.add(ab, BorderLayout.NORTH);
Box cdef = new Box(BoxLayout.X_AXIS);
Box cf = new Box(BoxLayout.Y_AXIS);
cf.add(C);
cf.add(F);
cf.add(Box.createVerticalGlue());
Box de = new Box(BoxLayout.Y_AXIS);
de.add(D);
de.add(E);
de.add(Box.createVerticalGlue());
cdef.add(cf, BorderLayout.WEST);
cdef.add(de, BorderLayout.EAST);
abcdef.add(cdef);
add(abcdef, BorderLayout.NORTH);
add(main);
}
public static void main(String[] args){
JPanel A = new JPanel();
A.setOpaque(true);
A.setBackground(Color.BLUE);
A.add(new JLabel("A"));
JPanel B = new JPanel();
B.setOpaque(true);
B.setBackground(Color.LIGHT_GRAY);
B.add(new JLabel("B"));
JPanel C = new JPanel();
C.setPreferredSize(new Dimension(0, 100));
C.setOpaque(true);
C.setBackground(Color.RED);
C.add(new JLabel("C"));
JPanel D = new JPanel();
D.setOpaque(true);
D.setBackground(Color.PINK);
D.add(new JLabel("D"));
JPanel E = new JPanel();
E.setOpaque(true);
E.setBackground(Color.YELLOW);
E.add(new JLabel("E"));
E.setPreferredSize(new Dimension(0, 60));
JPanel F = new JPanel();
F.setOpaque(true);
F.setBackground(Color.MAGENTA);
F.add(new JLabel("F"));
JPanel main = new JPanel();
main.setOpaque(true);
main.setBackground(Color.WHITE);
main.add(new JLabel("main"));
GladysPanel panel = new GladysPanel(A, B, C, D, E, F, main);
JFrame example = new JFrame("Gladys example");
example.setContentPane(panel);
example.setSize(300, 300);
example.setVisible(true);
}
}
you can omit the setPreferredSize(), I added it only to demonstate behaviour. You can also try to resize the window. The code is much much shorter that when using GridBagLayout.