问题
I am trying to allow the user to create a new tab in my application.
I tried the tab.setContent(tag.getContent()); but it moves the content of one tab to the other leaving the first one empty.
Is there a way to make a copy of the tab content ?
回答1:
I made a separate FXML file for a tab, created a loader for the FXMl file, then load it to get the root. Use the root to build a scene and finally add the scene to the TabPane!
来源:https://stackoverflow.com/questions/20273820/how-to-copy-content-from-one-tab-to-another-in-javafx