My easy application has two layout panes. First is VBox pane. It is root node. Second pane is child pane (Pane layout). I want to use DropShadow effect for root pane only. I do it according to the documentation . Unfortunately I have the Drop shadow effect for both panes. For root and for child. Is it a bug or there is a way to set it for one pane only? I was trying to use pane.setEffect( null ) but without success. When I add some child to pane, the new node has shadow also.
I use JavaFX8 (Windows 7 - 64).
Thank you.
public void start( Stage stage )
{
VBox vbox = new VBox();
vbox.setPadding( new Insets( 30 ) );
BorderStrokeStyle style = new BorderStrokeStyle( StrokeType.INSIDE, StrokeLineJoin.MITER, StrokeLineCap.BUTT, 10, 0, null );
BorderStroke stroke = new BorderStroke( Color.BLUE, style, CornerRadii.EMPTY, new BorderWidths( 1 ), null );
vbox.setBorder( new Border( stroke ) );
DropShadow dropShadow = new DropShadow();
dropShadow.setOffsetX( 10 );
dropShadow.setOffsetY( 10 );
vbox.setEffect( dropShadow );
Pane pane = new Pane();
pane.setBorder( new Border( stroke ) );
pane.setPrefWidth( 500 );
pane.setPrefHeight( 500 );
vbox.getChildren().add( pane );
stage.setScene( new Scene( vbox ) );
stage.show();
}
addition:
Was trying to use css: vbox.setStyle( "-fx-effect: dropshadow(gaussian, gray, 10, 0.6, 10, 10);" ); The same shit - the effect was applied for both panes. ((