2013-09-27 84 views
1
SkinBase skin = (SkinBase) tabPane.getSkin(); 
    TabPaneBehavior tabPaneBehavior = (TabPaneBehavior) skin.getBehavior(); 
    tabPaneBehavior.selectNextTab(); 

在Java 8中沒有這樣的方法,我該如何獲得行爲?java 8 javafx getBehavior()的替代?

回答

1

你試過:

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