gpt4 book ai didi

java - 替代 SplitPane 来分割 "content",加上 TitlePane 折叠/展开问题;我应该用什么代替?

转载 作者:太空宇宙 更新时间:2023-11-04 06:16:22 25 4
gpt4 key购买 nike

FXML 的匹配部分:

    <SplitPane dividerPositions="0.5" orientation="VERTICAL">
<TreeView fx:id="parseTree" editable="false"/>
<TitledPane collapsible="true" text="Node information">
<TextArea fx:id="parseNodeDetails" editable="false"
style="-fx-font-family: monospace"/>
</TitledPane>
</SplitPane>

这是我当前的布局:

enter image description here

现在,第一个问题是当我折叠然后展开 TitlePane 时。从上面的情况出发,可以得出:

enter image description here

我想要的是它扩展到之前的大小(事实上,SplitPane 允许的最大位置。有可能做到这一点吗?

我遇到的另一个问题是 SplitPane 的分隔线显然不是“可隐藏的”;我见过使用 CSS 的解决方案(例如 here),但它看起来有点难看...如果我用其他东西替换 SplitPane,但 TitlePane 扩展仍然有大小限制,我应该使用什么?

最佳答案

我使用 BorderPane 做了类似的事情:将 TreeView 放在中间,将 TitledPane 放在底部。

或者,您也可以尝试将 TreeView 和 TitledPane 放入 VBox 中。设置 VBox.setVgrow( 树, Priority.ALWAYS );

关于java - 替代 SplitPane 来分割 "content",加上 TitlePane 折叠/展开问题;我应该用什么代替?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28043214/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com