Javafx 2 如何使按钮透明

Javafx 2 如何使按钮透明,javafx-2,Javafx 2,我正在制作一个javafx应用程序,其中有一个带有背景图像的边框窗格。这个边框窗格上的按钮应该是透明的。我似乎不能用混合模式来完成这一点,我也不能。请帮帮我!!! 抱歉,我无法发布代码css: .button{ -fx-background-color: transparent; } Javafx代码: Button buttonColor = new Button("Color"); buttonColor.setStyle("-fx-background-color: tran

我正在制作一个javafx应用程序,其中有一个带有背景图像的边框窗格。这个边框窗格上的按钮应该是透明的。我似乎不能用混合模式来完成这一点,我也不能。请帮帮我!!! 抱歉,我无法发布代码

css:

.button{
     -fx-background-color: transparent; 
}
Javafx代码:

Button buttonColor = new Button("Color");
buttonColor.setStyle("-fx-background-color: transparent;");
你可以简单地使用

button.setVisible(false);
要使其透明,如果要使其再次显示,只需使用

button.setVisible(true);