Share the post "How To Add Drop Shadow In Stage Window In Java FX 2"
Back then, I made a post on how to create a simple custom popup dialog but the problem is that it is flat out boring.
There is no sense of depth that makes it appear 3D or something. Luckily, with CSS I was able to add a drop shadow effect behind the Stage window to make it look like the photo below.
It looks better than without a shadow, right?
Here is the full CSS code.
|
1 2 3 4 5 6 7 8 9 10 11 |
.root { -fx-effect: dropshadow(gaussian, rgba(0, 0, 0, 0.4), 10, 0.5, 0.0, 0.0); -fx-background-radius: 5; -fx-padding: 10; } .content { -fx-background-color: #c0c0c0; -fx-background-radius: 5; -fx-padding: 10; } |