5

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:

enter image description here

You can see the shadow slightly on the bottom right, but as soon as the main application area ends the shadow is cut off.

Community
  • 1
  • 1
Tower
  • 98,741
  • 129
  • 357
  • 507

1 Answers1

7

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.

Sample shadowed dialog

jewelsea
  • 150,031
  • 14
  • 366
  • 406