Using Layout Managers
In Java, the placement of components within a container depends on the size of other components and the height and width of the container. The layout of buttons, text fields, and other components can be affected by the following things:
The size of the container
The size of other components and containers
The layout manager that is being used
There are several layout managers you can use to affect how components are shown. The default manager for panels is the FlowLayout class in the java.awt package, which was used during the previous hour.
Under FlowLayout, components are dropped onto an area in the same way words are organized on a printed page in English—from left to right, then on to the next line when there's no more ...