JavaFx - button to close tabs

I created a tab and added it to TabPane. I set its private property to TRUE. How can I open the close button?

+4
source share
2 answers

I have been looking for an answer for a long time, the answer is very simple.

Just set TabClosingPolicy

TabPane.TabClosingPolicy.SELECTED_TAB

+17
source

In the fxml file, the file property can be added to the tabplane as tabClosingPolicy = "SELECTED_TAB" or "ALL_TABS"

+5
source

All Articles