public class Box extends JComponent implements Accessible
使用 BoxLayout 对象作为其布局管理器的一个轻量级容器。
Box 提供几个对使用 BoxLayout 的容器(甚至非 Box 容器)有用的类方法。

Box 类可以创建几种影响布局的不可见组件:glue、struts 和 rigid 区域。如果 Box 包含的所有组件都有一个固定大小,可以使用 glue 组件(由 createGlue 返回)来控制组件的位置。如果想让两个组件之间有一个固定的空间量,可以尝试使用 strut(createHorizontalStrut 或 createVerticalStrut)。如果需要一个总是占用相同空间量的不可见组件,可以通过调用 createRigidArea 获得。

相关文章:

  • 2022-12-23
  • 2021-06-03
  • 2022-12-23
  • 2021-06-16
  • 2022-12-23
  • 2022-12-23
  • 2021-05-20
  • 2021-06-25
猜你喜欢
  • 2022-12-23
  • 2022-01-07
  • 2022-12-23
  • 2021-04-12
  • 2021-08-01
  • 2021-09-20
  • 2021-06-06
相关资源
相似解决方案