How to reduce space between JCheckboxes in GridLayout

后端 未结 3 828
别跟我提以往
别跟我提以往 2021-01-06 01:21

I have three Java JCheckboxes in a column, arranged by setting the layout of the container JPanel to GridLayout(3, 1, 1, 1). When I r

3条回答
  •  遥遥无期
    2021-01-06 01:55

    Does it help if you set the checkbox's border?

    JCheckBox checkBox = new JCheckBox();
    checkBox.setBorder(BorderFactory.createEmptyBorder());
    

    It may also be due to the Look & Feel's UI delegate's rendering. You typically have little control over this.

提交回复
热议问题