I have many panes in my .fxml
file ( here is the earlier version of my fxml: Javafx : SplitPane resize children) Now I want to fix the first two elements in the split pane in the top of my view, so I put them out of the ScrollPane
but now the problem is that I cannot scroll the rest of the panes, and I have no idea why. I tried to wrap them into a BorderPane
, another try was that to wrap them in a SplitPane
so the those two panes become items in the SplitPane
and the third item is the ScrollPane
but none of the worked. Do you have any idea what did I miss, or any solution for this problem?
Edit : So here is the code that I have tried, so I put the first two elements out of ScrollPane
<TitledPane>
<TextArea fx:id="taTop" wrapText="true" editable="false" prefHeight="100"/>
</TitledPane>
<TitledPane>
<TableView fx:id="tableFrist" minHeight="120" maxHeight="120">
<columns>
<TableColumn fx:id="column" prefWidth="200"/>
</columns>
</TableView>
</TitledPane>
<ScrollPane AnchorPane.topAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.bottomAnchor="0.0"
AnchorPane.leftAnchor="0.0">
<SplitPane orientation="VERTICAL" fx:id="splitPane">
<TitledPane>
<TreeTableView fx:id="tableSecond">
<columns>
<TreeTableColumn fx:id="columnTreeS" prefWidth="200"/>
</columns>
</TreeTableView>
</TitledPane>
<TitledPane>
<TreeTableView fx:id="tableThird">
<columns>
<TreeTableColumn fx:id="columnTreeT" prefWidth="200"/>
</columns>
</TreeTableView>
</TitledPane>
<TitledPane>
<TextArea fx:id="taBot" wrapText="true" editable="false"/>
</TitledPane>
</SplitPane>
</ScrollPane>
So when I expand all panes there is no scrollbar so I cannot scroll down to the other panes.
I have found the solution, in my controller class i have inserted this line:
scrollPane.prefHeightProperty().bind(contentPane.heightProperty());
and it solved my problem, I guess the ScrollPane
had Infinite
height so the scrollbar had never sown.