The JPanel class can be used either as a container for components, or as a blank area for drawing custom graphics. When used as a container it can have any one of a number of LayoutManager objects installed. These objects implement various strategies for laying out the components contained in the panel.
When used as a container, a JPanel is constructed with one of the following constructors.
The default layout manager for a JPanel is a FlowLayout.