我可以在 BorderLayout 中强制自动换行吗

发布于 2024-08-30 01:12:58 字数 54 浏览 3 评论 0原文

我想知道是否可以强制 BorderLayout 中的组件像 FlowLayout 中那样换行。

I was wondering if it is possible to force components in BorderLayout to wrap like they do in FlowLayout.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

决绝 2024-09-06 01:12:58

使用 FlowLayout 时,组件将自动换行。问题是面板的高度不会自动增加,因此您可能永远看不到包裹的组件。 换行布局尝试解决此问题。

When using a FlowLayout the components will wrap automatically. The problem is that the height of the panel does not increase automaically, so you may never see the wrapped components. The Wrap Layout tries to address this issue.

一片旧的回忆 2024-09-06 01:12:58

BorderLayout原则上只有5个位置:北、南、东、西、中。如果您想对其中一个位置进行微观管理,最好在其中放置一个 JPanel,并调整其布局(例如,将其设置为 FlowLayout)。

BorderLayout, in principle, have only 5 positions: North, South, East, West and Center. If you want to micro-manage one of those positions, it is best that you put a JPanel there, and tweak its layout (e.g., set it to FlowLayout).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文