Search code examples
javajavafxjavafx-3d

Javafx 3D disapear in split pane


I developed a 3d plotting tool (so-called A; which is a subscene). I want to put this subscene in a Split Pane (B). The problem is a part of my scene disappears (when I rotate the plot some parts appear). as you can see below: trauncated plot

However; when I use HBox or Pane instead of SplitPane, everything works well. the code is here(I simplified it for better understanding)

SplitPane splitPane = FXMLLoader.load(getClass().getResource("sample.fxml"));  
Scene scene =new Scene(splitPane); 
Pane pane = new HBox(); 
pane.getChildren().add(A); 
splitPane.getItems().add(pane); 
primaryStage.setScene(scene);

Solution

  • I solve it. It is a little bit tricky but in the subcode of sub-scene A; I use Stackpane as a root. I changed it to Group. everything works well.