Trying to create a drop-shadow to my BorderPane
. I need to use a StackPane
to allow room for the drop-shadow. The problem is I cannot seem to set the background of StackPane
to transparent. I am using transparent style for my primiaryStage
.
There are other example using javaFX which work but, I can't figure it out when using fxml.
.StackPane{
-fx-background-color: transparent;
}
This still shows a white background behind my BorderPane
public class Main extends Application {
public static Stage Window;
@Override
public void start(Stage primaryStage) throws IOException{
Main.Window = primaryStage;
Window.initStyle(StageStyle.TRANSPARENT);
Window.setResizable(false);
FXMLLoader loader = new FXMLLoader(getClass().getResource("Homepage.fxml"));
Parent root = loader.load();
Window.setScene(new Scene(root));
root.getStylesheets().add(getClass().getResource("main.css").toExternalForm());
Window.show();
}