Class FlexibleGridLayout
java.lang.Object
java.awt.GridLayout
ece.ing3.java.projet.vue.components.FlexibleGridLayout
- All Implemented Interfaces:
LayoutManager
,Serializable
Grid Layout which allows components of differrent sizes
Based on https://www.javaworld.com/article/2077486/core-java/java-tip-121--flex-your-grid-layout.html
- Author:
- Bogdan Dorohonceanu
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCreate a new flexible grid with 1 row and no gaps.FlexibleGridLayout
(int rows, int cols) Create a new flexible grid with the defined number of rows and columns, and no gaps.FlexibleGridLayout
(int rows, int cols, int hgap, int vgap) Create a new flexible grid -
Method Summary
Modifier and TypeMethodDescriptionvoid
layoutContainer
(Container parent) minimumLayoutSize
(Container parent) preferredLayoutSize
(Container parent) Methods inherited from class java.awt.GridLayout
addLayoutComponent, getColumns, getHgap, getRows, getVgap, removeLayoutComponent, setColumns, setHgap, setRows, setVgap, toString
-
Constructor Details
-
FlexibleGridLayout
public FlexibleGridLayout()Create a new flexible grid with 1 row and no gaps. -
FlexibleGridLayout
public FlexibleGridLayout(int rows, int cols) Create a new flexible grid with the defined number of rows and columns, and no gaps.- Parameters:
rows
- Number of rowscols
- Number of columns
-
FlexibleGridLayout
public FlexibleGridLayout(int rows, int cols, int hgap, int vgap) Create a new flexible grid- Parameters:
rows
- Number of rowscols
- Number of columnshgap
- Horizontal gap between cellsvgap
- Vertical gap between cells
-
-
Method Details
-
preferredLayoutSize
- Specified by:
preferredLayoutSize
in interfaceLayoutManager
- Overrides:
preferredLayoutSize
in classGridLayout
-
minimumLayoutSize
- Specified by:
minimumLayoutSize
in interfaceLayoutManager
- Overrides:
minimumLayoutSize
in classGridLayout
-
layoutContainer
- Specified by:
layoutContainer
in interfaceLayoutManager
- Overrides:
layoutContainer
in classGridLayout
-