With FlowLayout, as you add components, they’ll be aligned horizontally (in a row) if the frame length is small; then FlowLayout will create more rows to accommodate the placement of the components. Take a look at how this works in the code.
S01E29 · Java Swing: BorderLayout
S01E31 · Java Swing: BoxLayout