I am using a grid-layout to set a group of around 256 Check-boxes on a JPanel. In the grid-layout documentation i can see that there are 2 methods i.e setHgap() and setVgap(). I am not sure between which components do these methods create gaps; would it be the adjacent checkboxes or the other components within the JPanel.
Asked
Active
Viewed 523 times
1 Answers
3
setHgap() and setVgap() sets horizontal & vertical gaps respectively between components on the container itself and not along the 'edges'.

Reimeus
- 158,255
- 15
- 216
- 276
-
so in my case would it be the adjacent checkboxes? – Ankit Aug 08 '12 at 00:13
-
1yes, the gaps are internally between all checkboxes on the container. – Reimeus Aug 08 '12 at 00:21
-
Add an empty border to the enclosing container to complement the gaps, as shown [here](http://stackoverflow.com/a/7452088/230513). – trashgod Aug 08 '12 at 00:29