All of the shapes we have used so far have been rendered pretty bland with boring solid colors. Let's say you want to enhance the look of your objects by adding depth for a more engaging look. This recipe shows you how to use the
Effect classes to add lighting and shadow effects to visual nodes in the scene graph.
All Node instances can receive an effect through the
effect:Effect property. You can find all effects in the package
javafx.scene.effect. For this recipe, we are going to use effects classes
Lighting, DistantLighting, and
The abbreviated code listing given next shows you how to use the Lighting and the DropShadow effects to enhance the appearance of a ...