How to add shadow to a window in JavaFX?

I removed the default borders in the main step:

stage.initStyle(StageStyle.UNDECORATED)

This removes the window borders that I want, but now I want to have a shadow under the window.

The top-level object BorderPanehas an effect dropshadow, but the shadow is disabled:

enter image description here

You can slightly see the shadow in the lower right corner, but as soon as the main application area ends, the shadow turns off.

+5
source share
1 answer

I created an example for this earlier. Use a specific revision related, as in future versions. I dropped the shadow effect from the dialog box.

StackPane, . , . , .

, / .

Sample shadowed dialog

+6

All Articles