Swing Layout Managers in Java
The AI Revolution MALAYALAM ARTICLE
Swing layout manager.
The layout manager automatically positions all the components within the container.
Layout refers to the arrangement of components within the container.
Layout is placing the components at a particular position within the container. The task of laying out the controls is done automatically by the layout manager.
Even if you do not use the layout manager, the components are still positioned by the default layout manager. It is possible to lay out the controls by hand, however, it becomes complicated.
Java provides various layout managers to position the controls. Properties like size, shape, and arrangement vary from one layout manager to another.
There are the following classes that represent the layout managers:
java.awt.BorderLayout
java.awt.FlowLayout
java.awt.GridLayout
java.awt.CardLayout
java.awt.GridBagLayout
javax.swing.GroupLayout
javax.swing.ScollPaneLayout
javax.swing.SpringLayout etc
An example picture of the border layout and grid layout is given below
https://www.amazon.com/dp/B0DS2H417Y
ReplyDelete