Upload
guo-albert
View
780
Download
2
Tags:
Embed Size (px)
Citation preview
+
GridBagLayout Quick StartAlbert [email protected]
+What is GridBagLayout ?
GridBagLayout is the most complex and most flexible of the layout managers.
With GridLayout, elements are arranged in a rectangular grid, and each element in the container is sized identically (where possible).
With GridBagLayout, elements can have different sizes and can occupy multiple rows or columns
Note The maximum capacity of a screen using GridBagLayout is
512 rows by 512 columns. This is specified by the protected MAXGRIDSIZE constant of the layout manager
2
+What is GridBagLayout ?
3
+GridBagConstraints Class
The magic of the layout manager is strictly controlled by the different GridBagConstraints objects passed in for each component added to the container.
Each specifies how to display a specific component. Unlike most other layout managers, which have a built-in idea about what to do with their display, the GridBagLayout is a blank slate.
The constraints attached to the components tell the layout manager how to build its display.
4
+ 5
+Create a Add Job Duty Frame
btnPanel includes save button and reset button
6
0
1
2
3
4
0 1 2 3
+GridBagLayout & GridBagConstraints
7
+Class Diagram
8
+Sequence Diagram
9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+Demo
17
0 1 2 3
0
1
2
3
4