📄 e633. setting gap sizes in a gridbadlayout.txt
字号:
Unlike most of the other layout managers, the gridbag layout manager does not have a property for controlling the size of the gaps between cells. You could implement gaps using insets (see e630 Setting the Space around a Component Within the Cell of the GridBagLayout Using Insets. However, this method is tedious and any change in the layout requires major changes with the insets.
The next best method is to create a blank column or row explicitly for the desired gaps.
// Assume components have been added in cells
// (0,0), (0,2), (2,0), (2,2)
// Create a 10 pixel gap between columns 0 and 2
setColumnMinWidth(gbl, 1, 10);
// Create a 10 pixel gap between rows 0 and 2
setRowMinHeight(gbl, 1, 10);
// setColumnMinWidth() and setRowMinHeight() are defined in
// e632 Setting a Row or Column of a GridBadLayout to a Particular Size
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -