JavaFX:GUI的独立部分要精确地分成两半,百分比不是像素

是否可以将左半部分和右半部分(如下图所示)精确地分成两半?它应该恰好是绿线的一半。

如果可能,我不想使用固定的像素大小,而是使用百分比!

提前THX!

linecharts

在我的.fxml文件中,我具有以下代码(不包括最左侧的内容)

<AnchorPane minHeight="352.0" minWidth="352.0" prefHeight="566.0" prefWidth="566.0">
        <children>
            <ScrollPane fitToWidth="true" prefHeight="561.0" prefWidth="566.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.topAnchor="0.0" AnchorPane.rightAnchor="0.0">
                <content>
                    <VBox fx:id="left_side" prefWidth="100.0" prefHeight="200.0" />
                </content>
            </ScrollPane>
        </children>
    </AnchorPane>
    <AnchorPane minHeight="352.0" minWidth="352.0" prefHeight="566.0" prefWidth="566.0">
        <children>
            <ScrollPane fitToWidth="true" prefHeight="561.0" prefWidth="566.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.topAnchor="0.0" AnchorPane.rightAnchor="0.0">
                <content>
                    <VBox fx:id="right_side" prefWidth="100.0" prefHeight="200.0" />
                </content>
            </ScrollPane>
        </children>
    </AnchorPane>
yzp0754 回答:JavaFX:GUI的独立部分要精确地分成两半,百分比不是像素

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/2838974.html

大家都在问