我有一个简单的代码来将选项卡添加到 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);
}
通过鼠标左键双击一个选项卡,我想重命名(通过输入新文本)选定的选项卡:我该怎么做?