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 TypeMethodDescriptionvoidlayoutContainer(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:
preferredLayoutSizein interfaceLayoutManager- Overrides:
preferredLayoutSizein classGridLayout
-
minimumLayoutSize
- Specified by:
minimumLayoutSizein interfaceLayoutManager- Overrides:
minimumLayoutSizein classGridLayout
-
layoutContainer
- Specified by:
layoutContainerin interfaceLayoutManager- Overrides:
layoutContainerin classGridLayout
-