Reputation: 147
I am using Java FX for a desktop application.Can i change a scene inside one scene?First scene has an anchorpane inside which one another anchor pane is included.Can i change the scene in the second anchorpane?
Upvotes: 0
Views: 1827
Reputation: 1061
just load AnchorPane inside Anchorpane. no need of creatinig new scene..
AnchorPane main=new AnchorPane();
AnchorPane sub=new AnchorPane();
sub.getChildren().add(btn);
main.getChildren().add(sub);
Scene is super class to Node so i think its impossible to load scene inside Scene. however u can switch scenes in a stage.
Upvotes: 1