如何限制 JSplitPane 中分隔符的位置?

发布于 2024-12-21 00:16:02 字数 72 浏览 3 评论 0原文

有没有办法限制 JSplitPane 分隔符的位置? 我想防止它在两端附近结束。用户是否拖动 分隔符,或者由于窗口大小调整而重置。

Is there a way to restrict the location of the separator of a JSplitPane?
I want to prevent it from ending up near either end. Whether the user drags
the separator, or it is reset due to window resize.

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

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

发布评论

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

评论(1

半夏半凉 2024-12-28 00:16:02

请参阅有关 JSplitPane 的 Swing 教程。更具体地说, Divider 部分包含一个示例,其中分隔符不能拖到最后。基本上,它归结为设置分割窗格中包含的组件的最小大小

See the Swing tutorial about JSplitPanes. More specifically the Divider section contains an example where the separator can not be dragged towards the end. Basically it comes down to setting the minimum size of the components contained in the split pane

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