How to copy content from one tab to another in JavaFX?

最后都变了- 提交于 2019-12-11 03:37:24

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!