I have a simple code to add tab(s) to a tabPane
@FXML
private void addNewWorkspaceTab(ActionEvent event) {
Tab workspaceTab = new Tab();
workspaceTab.setText("New Workspace");
tabpaneWorkspace.getTabs().addAll(workspaceTab);
tabpaneWorkspace.setTabClosingPolicy(TabPane.TabClosingPolicy.SELECTED_TAB);
}
By double left mouse click on a tab I would like to rename (by typing a new text) the selected tab: how can I do this?
Here is a solution for my question: