简体   繁体   中英

Insert tab in between tabs in javafx tabpane

I am looking for the equivalent of this swing code:

tabPane.insertTab(String var1, Icon var2, Component var3, String var4, int var5);

in javafx.

I want to insert a tab in between tabs in tab pane.

Help me plz

Just modify the tabs list according to your needs:

String tabTitle = "tab title";
Node tabContent = ...; // tab content goes here
int index = ...; // index for new tab

Tab tab = new Tab(tabTitle, tabContent);
tabPane.getTabs().add(index, tab);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM