Reputation: 435
My CSS is:
.hollow {
-fx-background-color: #dddddd;
-fx-effect: innershadow( gaussian, rgba( 0, 0, 0, 0.5 ), 10, 0, 5, 5 );
}
I want to apply this effect to an HBox pane itself, giving it an appropriate CSS class, but instead of this the effect applies to its children (buttons, etc.).
How can I apply the effect only to the pane itself, living aside its children?
Edited:
Fixed a typo.
Upvotes: 2
Views: 6927
Reputation: 23
It worked for me with code in the controller.
hBox.setEffect(new InnerShadow(BlurType.THREE_PASS_BOX, Color.GRAY,2,0,0,0));
hBox.setStyle("-fx-background-color: white");
I dont know why css doesn
t work here.
Upvotes: 1