I have removed the default borders around the primary stage:
stage.initStyle(StageStyle.UNDECORATED)
This removes the window borders which is what I want, but now I'd like to have a drop shadow under the window.
The top level BorderPane
object has a dropshadow
effect applied, but the shadow is cut off:
You can see the shadow slightly on the bottom right, but as soon as the main application area ends the shadow is cut off.
Property description: The radius of the shadow blur kernel. This attribute controls the distance that the shadow is spread to each side of the source pixels. Setting the radius is equivalent to setting both the width and height attributes to a value of (2 * radius + 1) .
I created an example for this earlier. Use the specific revision linked as in later revisions I dropped the shadow effect from the dialog.
The sample places the stage content in a StackPane containing two panes. The shadow is only applied to the background Pane and the dialog content is placed in a top pane. The background of the top pane is slightly inset from the bottom pane so that the background and shadow can show through.
Further discussion is in a thread on displaying a shadow around an undecorated/transparent stage.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With