2016-04-30 93 views
0

我想通過CSS文件將燈光效果添加到按鈕,我已經搜索並只能找到通過JavaFx代碼執行的方法。任何人都可以幫忙嗎?`在CSS中添加JavaFX8中的燈光效果

.button.CommitButtonBig { 
     -fx-background-color: #24BE58; 
     -fx-text-fill: white; 
     -fx-background-radius: 5px; 

} 

.button.CommitButtonBig:hover{ 
    -fx-background-color: linear-gradient(#39e600, #39e600); 
} 

.button.CommitButtonBig:focused{ 
    -fx-effect: lighting; 
    } ` 

回答

3

無法通過CSS使用JavaFX 8.添加照明效果的-fx-effect屬性只支持陰影效果和特效在內陰影值。必須在代碼中添加燈光效果。