java - 禁止在 FlowLayout 中使用多行?

标签 java swing layout flowlayoutpanel flowlayout

我找不到如何禁用 Flowlayout 中自动创建行的功能重新调整容器大小时。文档中提到:

If the horizontal space in the container is too small to put all the components in one row, the FlowLayout class uses multiple rows.

如何禁用此功能?

最佳答案

不要使用 FlowLayout。相反,您是否尝试过以 BoxLayout.LINE_AXIS 形式组织的 BoxLayout。

关于java - 禁止在 FlowLayout 中使用多行?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10162789/

相关文章:

java - Redis key 过期通知

java - 如何在 Restful Web 服务中编辑默认 URL

HTML 拉伸(stretch)一个 div 到底部

java - 使用 GridBagLayout 调整大小时防止组件散开

java - 迭代器和枚举的区别

java - CreateProcess error=2, 系统找不到指定的文件

java - 如何将数据从保存在 ArrayList 中的 textField 值添加到 JTable?

java - 我的 JFrame 未显示带图片的 JLabel

Java画带边框的线

layout - 节点之间的 BorderPane 间距