简体   繁体   English

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

[英]How can I restrict the location of the separator in JSplitPane?

Is there a way to restrict the location of the separator of a JSplitPane ? 有没有办法限制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. 用户是拖动分隔符,还是由于调整窗口大小而将其重置。

See the Swing tutorial about JSplitPane s . 请参阅有关JSplitPane的Swing教程 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 基本上,这取决于设置拆分窗格中包含的组件的最小大小。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM