Use the constructor CardLayout() to construct a CardLayout object.
#Flowlayout rows and columns series#
CardLayout (Card Layout Manager): It puts components on a series of cards, only one card can be seen at a time, and one card can only put one component. GridLayout (int row, intcolumns, int hgap, int, vgap): Construct a GridLayout object according to the specified number of rows and columns, and the component spacing is set according to the specified value.Ĥ. GridLayout (int row, int columns): Construct a GridLayout object according to the specified number of rows and columns, and the component spacing is 0.ģ. GridLayout() constructs a GridLayout object with one row per column.Ģ.
The construction methods are as follows:ġ. The components in the grid are the same size. GridLayout (Grid Layout Manager): The container is divided into grids of the same size, and the components are placed in the blank spaces of the grid in the same order as the flow layout. BorderLayout(int hgap,int vgap): Create a layout object with the specified component spacing.ģ. BorderLayout(): Create a layout object with no spacing between components.Ģ. The construction method has the following types:ġ. The second parameter indicates the position of the component, which is taken as: BorderLayout.North, BorderLayout.South, BorderLayout.East, BorderLayout.West, BorderLayout.Center. Use the add(component, index) method to add components to the container. BorderLayout (border layout management): divide the container into five areas: top, bottom, left, right, and middle, corresponding to North (North), South (South), West (West), East (East) and Center (Central District). The align value indicates the alignment of the component: CENTER (center alignment), LEFT (left alignment), RIGHT (right alignment).Ģ.
FlowLayout (int align): Create and specify the alignment of each row, and the component spacing is 5 pixel units.
FlowLayout(): Create each row of components to be aligned in the center, and the component spacing is 5 pixel units.Ģ. There are several construction methods:ġ. FlowLayout (flow layout management): Its components are placed in order from top to bottom, and from left to right.