Answer:

The trick is to use another panel.

Panel in a Panel in a Panel

Morning Noon and Night

The left and right panels are put in yet another panel (called dataPan). The buttons are put in butPan Now dataPan and butPan are added to the content pane using BoxLayout and vertical alignment. The picture shows how this works.

This idea of nesting panels is a powerful one. It may look complicated and tedious, but it is much less so than laying out a design on graph paper and specifying the exact size and location of all the components. Such a design has no flexibility. What happens if you want to add or delete a component? Everything must change. With Java's layout managers everything is dynamically adjusted.

QUESTION 13:

(Thought Question: ) Do you imagine that Java has a way that allows the programmer to exactly specify the size and location of components?