java - java中boxlayout的x_axis和line_axis有什么区别?

标签 java swing jpanel boxlayout

x_axis 和 line_axis 都是从左到右排列组件。那它们有什么区别呢?

这个问题来自 Java Swing boxlayout 布局管理器。

最佳答案

来自官方documentation :

X_AXIS - Components are laid out horizontally from left to right.

LINE_AXIS - Components are laid out the way words are laid out in a line, based on the container's ComponentOrientation property. If the container's ComponentOrientation is horizontal then components are laid out horizontally, otherwise they are laid out vertically. For horizontal orientations, if the container's ComponentOrientation is left to right then components are laid out left to right, otherwise they are laid out right to left. For vertical orientations components are always laid out from top to bottom.

关于java - java中boxlayout的x_axis和line_axis有什么区别?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17549662/

相关文章:

java - 如何使用 Tomcat 配置 HTTPS?

java - 更改jtable的列宽

java - 我需要将面板拆分两次,但我不知道该怎么做

java - 如何在java中创建这种类型的Jtable

java - 本地化和 L&F

java - 如何在 CLONE JPanel 中使用 paint()?

java - 如何在 JPanel 中绘制字符串

java - 如何加快列表比较/字符串替换?

java - GET请求参数的字符编码

java - 将所有字段名称从 firestore 文档获取到 arraylist