一度に複数の折りたたみ可能なTitledPane(デフォルトのJavaFXアコーディオンではサポートしていない)が必要なので、いくつかのTitledPanesをVBoxに追加しました。これまでのところうまく動作しますが、TitledPanesの幅は実際のVBoxの幅よりも10px小さいことに気付きました。VBoxをTitledPaneで埋めるJavaFX埋め込み
後FXMLコード:これは(右のギャップを参照)を生成
<Pane prefHeight="700.0" prefWidth="1000.0" xmlns="http://javafx.com/javafx/8.0.71" xmlns:fx="http://javafx.com/fxml/1">
<children>
<VBox prefHeight="700.0" prefWidth="1000.0">
<children>
<TitledPane animated="false" text="Pane 1">
<content>
<AnchorPane prefHeight="300.0" />
</content>
</TitledPane>
<TitledPane animated="false" text="Pane 2">
<content>
<AnchorPane prefHeight="300.0" />
</content>
</TitledPane>
</children>
</VBox>
</children>
</Pane>
コード:
VBox {
-fx-padding: 0 -11 0 -1;
}
私の場合、この解決策はうまくいきますが、貧弱な回避策のようです。私はスマートな解決策が必要だと思いますか?事前に
どうもありがとう:)
おかげで、それはそれでした! ;-) – pixelstuermer