1), FlowLayout Manager
It is the default layout manager class for panels that, when used, arranges components in the same way that the English words are arranged in the page: from left to right, the current row has no space and then goes to the next line.
When you add a component to a frame, you can use the following code example to invoke a floating layout:
FlowLayout layout = new FlowLayout ();
SetLayout (layout);
You can also specify a layout manager for a specific container, such as a Jpanle object, to use the SetLayout () method of the Container object.
The FlowLayout class arranges components only according to the size of the container. When the application window is resized, the components are rearranged immediately. By increasing the width of the window to twice times the original, all JButton components are found to be displayed on the same line.
10.4 Using Layout Manager 1 (flowlayout)