java 8 javafx getBehavior()替代?

时间:2013-09-27 10:08:27

标签: java javafx-8 java-8

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

Java 8中没有这样的方法,我怎样才能获得行为?

1 个答案:

答案 0 :(得分:1)

你试过了吗?

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