2016-04-30 27 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属性只支持阴影效果和特效在内阴影值。必须在代码中添加灯光效果。