非常简单的问题:我如何消除包含两个
以下是代码:
JCheckBox
的两个单元格之间的垂直间隙? 我用红色边框在图片中标记了间隙。以下是代码:
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JFrame;
import javax.swing.JPanel;
import net.miginfocom.swing.MigLayout;
public class Main {
public static void main(String[] args) {
JPanel somePanel = new JPanel();
somePanel.setLayout(new MigLayout("insets 0, debug", "", ""));
somePanel.add(new JCheckBox("first option"), "h 20!");
somePanel.add(new JButton("click me"), "spany 2, h 40!, w 60%, wrap");
somePanel.add(new JCheckBox("option two"), "h 20!");
JFrame frame = new JFrame();
frame.setContentPane(somePanel);
frame.pack();
frame.setVisible(true);
}
}