Creating a UI with nested layouts
FlowLayout
.
hgap
to a lower number to make both toolbars fit in the panel.
FlowLayout
object and set the following properties in the Inspector:
alignment
=LEFT
hgap
=5
vgap
=0
FlowLayout
object and set the following properties:
alignment
=RIGHT
hgap
=2
vgap
=0
Your toolbars should look something like this:
To complete the toolbars, you need to change the layout for panel 5.
BorderLayout
.
BorderLayout
forces panel 7 to the Center area and panel 8 to the East. While this will probably work fine, let's change the constraints for panel 7 in this BorderLayout
.
constraints
property in the Inspector. By doing this, you guarantee that when the user resizes the frame, the extra space will go in the gap between the second and third toolbars.