JavaFX Fit to parent when adding FXML file to SplitPane -


i have splitpane treeview on left , content area on right. when click on item in treeview want display content on right. how load fxml create in scenebuilder. problem fxml doesn't fit splitpane. how load fxml file

if (selecteditem.getvalue() == "sample") {     try {         anchorpane pane = (anchorpane) fxmlloader.load(getclass().getresource("sample.fxml"));         splitpane.getitems().set(1, pane);     } catch (ioexception e) {         e.printstacktrace();     }            } 

how make anchorpane created fit original splitpane size?

aligning in fx pain i.t.a.

i suggest following:

<splitpane>     <treeview /> //left     <anchorpane anchorpane.bottomanchor="0.0" anchorpane.leftanchor="0.0" anchorpane.rightanchor="0.0" anchorpane.topanchor="0.0"> //right, anchors make content stick corner         <anchorpane fx:id="mydynamiccontent"/>     </anchorpane> </splitpane> 

with inner pane mydynamiccontent should stretched corners. please tell if answer.

you can try set ancorpane.* attributes on content dont need nested anchorpane.

edit: after thinking think need outer pane because "the container", without inner pane not stick to.


Comments

Popular posts from this blog

javascript - Karma not able to start PhantomJS on Windows - Error: spawn UNKNOWN -

c# - Display ASPX Popup control in RowDeleteing Event (ASPX Gridview) -

Nuget pack csproj using nuspec -