メソッドの初期化でこれを試してください:
@FXML
private TabPane tabPane;
private Tab clienTab = new Tab( "Clients" );
private Tab byMonthTab = new Tab( "By Months" );
private Tab aboutTab = new Tab( "About" );
@Override
public void initialize( final URL location, final ResourceBundle resources )
{
private ObservableList<Tab> observerList = null;
SingleSelectionModel<Tab> selectionModel = null;
if ( selectionModel == null )
{
selectionModel = tabPane.getSelectionModel();
}
if ( observerList == null )
{
observerList = FXCollections.observableArrayList();
}
observerList.add( clienTab );
observerList.add( monthsTab );
observerList.add( aboutTab );
tabPane.getTabs().setAll( observerList );
selectionModel.select( observerList.get( 1 ) );
}
そして後で、メニュー項目でこれを行うことができます:
@FXML
private void clickMenuItemClients( final ActionEvent event )
{
if ( selectionModel.isSelected( 1 ) )
{
selectionModel.selectNext();
}
}