【发布时间】:2012-01-10 06:46:33
【问题描述】:
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());
【问题讨论】:
标签: java swing user-interface jbutton boxlayout