如何限制 JSplitPane 中分隔符的位置?
有没有办法限制 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
请参阅有关
JSplitPane
的 Swing 教程。更具体地说, Divider 部分包含一个示例,其中分隔符不能拖到最后。基本上,它归结为设置分割窗格中包含的组件的最小大小See the Swing tutorial about
JSplitPane
s. 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