我在BoxLayout
组中有四个按钮。这里只展示了两个的样本,因为所有代码都是重复的。我想创建一些轻微的间距,以便它们之间不会互相重叠。我已经尝试了.add(Box.Create....)
中的几乎所有方法,但没有一个起作用。
enter.add(Box.createVerticalGlue());
enter.add(Box.createHorizontalGlue());
//enter.add(new JSeparator(SwingConstants.HORIZONTAL));
JButton float = new JButton("LOWER");
float.add(Box.createVerticalGlue());
float.add(Box.createHorizontalGlue());