Reputation: 43
I'm trying to layout a Stage using a GridPane as the root of the Scene.
row 1 contains a HBox
row 2 contains a SplitPane with orientation set to Vertical
The SplitPane contains a browser control and another SplitPane with orientation set to Horizontal. The inner SplitPane contains two TableViews.
I'm try to have the outer SplitPane resize as the window changes size (please forgive if I'm not using the correct terms). I've seen how this can be done when using fxml but I'm restricted to using Javafx 8 and must do this programmatically. If it matters I'm using Netbeans 8.1.
It would be most appreciated if someone could point me in the right direction.
thank you A.G.
Upvotes: 2
Views: 1002
Reputation: 43
It turns out the solution to resizing the outer SplitPane was to use the type's static setResizableWithParent method.
SplitPane.setResizableWithParent(outerPane, Boolean.TRUE);
With that addition the SplitPane resized vertically but was limited horizontally by the width of the GridPane. The grid only contains one column so setting a ColumnConstraint's PercentWidth property to 100 allows the grid and SplitPane to resize horizontally.
Upvotes: 2
Reputation: 2058
Try this code,
yourSplitPane.setMinSize(500, 400);
yourSplitPane.setMaxSize(500, 400);
Here, 500 is width and 400 is height.
Upvotes: 0