SkinBase skin = (SkinBase) tabPane.getSkin();
    TabPaneBehavior tabPaneBehavior = (TabPaneBehavior) skin.getBehavior();
    tabPaneBehavior.selectNextTab();


Java 8中没有这样的方法,如何获得行为?

最佳答案

你有没有尝试过:

TabPaneSkin skin = (TabPaneSkin) tabPane.getSkin();
//or BehaviorSkinBase skin = (BehaviorSkinBase) tabPane.getSkin();
TabPaneBehavior tabPaneBehavior = (TabPaneBehavior) skin.getBehavior();
tabPaneBehavior.selectNextTab();

07-26 06:19