Overview
In this tutorial, we will learn about Java Swing Layouts.
The Java Swing API provides us with various layouts that allow us to arrange Swing components within a container.
A layout manager is an implementation of the LayoutManager interface or LayoutManager2 interface. The layout manager object determines the position and size of a Swing component inside a container.
Some of the layouts are as follows:
- BorderLayout
- FlowLayout
- GridLayout
- GridBagLayout
- CardLayout
- GroupLayout
LayoutManager2 interface was introduced in the later version of the JDK. LayoutManager2 extends LayoutManager and provides additional methods.
The classes that implement LayoutManager are::
- GridLayout
- FlowLayout, etc
The classes that implement LayoutManager2 are as follows::
- CardLayout
- GridBagLayout
- BoxLayout
- BorderLayout
—
Java Tutorial on this website:
https://www.testingdocs.com/java-tutorial/
For more information on Java, visit the official website :
https://www.oracle.com/in/java/