dock-test

A quick minimal example to show an error when trying to allow the user to programatically add tabs.

Run the example, the user can click the buttons in each tab freely without errors.

However when you press the buttons on the left, which tries to add many tabs insequence:

addTabsQuicklyButton.setOnAction(event -> {
        tabPane.placeTab(createTab(), Pos.CENTER_RIGHT);
        tabPane.placeTab(createTab(), Pos.CENTER_RIGHT);
        tabPane.placeTab(createTab(), Pos.CENTER_RIGHT);
        tabPane.placeTab(createTab(), Pos.CENTER_RIGHT);
    });

and

addTabsQuicklyButton2.setOnAction(event -> {
        tabPane.placeTab(createTab(), Pos.CENTER_RIGHT);
        tabPane.placeTab(createTab(), Pos.CENTER_RIGHT);
        tabPane.placeTab(createTab(), Pos.TOP_CENTER);
        tabPane.placeTab(createTab(), Pos.CENTER_RIGHT);
    });

the latter causes an error which is what I want to fix.

image