Applying basic effects
All effects can be applied to any Node
on the SceneGraph through the effectProperty()
and corresponding Node.setEffect(Effect value)
methods.
Adding shadow effects
Shadows are one of the oldest effects. They were used to imitate three dimensions on a flat paper surface even before the advent of computers. In the next sections, we will review the different types of shadow provided by the JavaFX Effects API.
Using DropShadow
The javafx.scene.effect.DropShadow
effect is a shadow which imitates different light source locations, and is drawn outside the shadowed node, as in the following example:

To add DropShadow
, you just need to instantiate a corresponding class with the desired parameters:
// chapter8/basiceffects/DropShadowDemo.java public void start(Stage stage) throws Exception { Circle red = new Circle(50, Color.RED); red.setEffect(new DropShadow()); Circle yellow = new Circle(50, Color.YELLOW); yellow.setEffect(new DropShadow( 10, //...