Add dropShadow only to border of grid pane JavaFx 2.2

后端 未结 2 1564
花落未央
花落未央 2020-12-29 14:50

Want to add drop shadow only to the border of Grid pane not to inner child elements

\"enter

2条回答
  •  Happy的楠姐
    2020-12-29 15:10

    jewelsea's answer is correct, but please note that it does not work when

    // explicitly transparent
    -fx-background-color: transparent;
    

    or

    // effectively transparent
    -fx-background-color: #FFFFFF00;
    

    This can be really frustrating if you are trying to apply the drop shadow to the (Stack)Pane's entire bounding box area and not it's child contents! Setting a non-transparent background color works, but if you have many elements side by side or on top of each other (i.e. close together), you may see undesirable overlap effects with the drop shadows.

提交回复
热议问题