When I close a tab in a TabPane, the TabPane-content area is left empty. I added a listener to deal with this like so:

        tabs.getTabPaneListeners().add(new TabPaneListener.Adapter() {
public void tabsRemoved(TabPane tabPane, int index, Sequence<Component> tabs) {
                if (tabPane.getTabs().getLength() > 0) {
                    int leftOfClosedTabIndex = Math.max(0, index - 1);
                    tabPane.setSelectedIndex(leftOfClosedTabIndex);
                }
            }
        });

Is it correct that there is no such functionality or policies to choose from in the framework? I'm not saying it's a bad thing though :)

-- Edvin

Reply via email to