javalayoutjavafx-8fxmlfxmlloader

How to change one half of a split pane while keeping the other the same when an action occurs in javafx


I am trying to create an application in javaFX that has two main halves to it. One side where you have a set of buttons or controls, and the other where it displays a different set of data for each button pressed, almost as if one side changes scenes, but the point is, layout panes count as scenes and I am still trying to figure out how to dynamically change one side while the other remains static. If you know how to accomplish this(Ideally with a split pane), then that would be a great help, as I am yet to find this question answered.

Thanks


Solution

  • SplitPane has a .getItems() method.

    Use that and .set() the content you want at the correct index.