1

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

ProvingBard
  • 333
  • 4
  • 12
  • Just change the contents of the layout in the second part of the `splitpane` will get the job done. Have you tried something which doesn't work, if yes please add them to the question. – ItachiUchiha Apr 15 '15 at 08:34

1 Answers1

2

SplitPane has a .getItems() method.

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

fge
  • 119,121
  • 33
  • 254
  • 329
  • This has worked for me in a normal javaFx file, but i have not been able to make it work using FXML, is there anything else i should be doing? This was just a simple test to see if it would work: `public void changeDisplay(ActionEvent event) throws IOException{ AnchorPane pane = FXMLLoader.load(getClass().getResource("/fxml/test.fxml")); splitPane.getItems().set(1, pane); }` – ProvingBard Apr 17 '15 at 02:43