JavaFX Shadow Effect

As its name suggests, this effect creates the shadow of the node by duplicating the node and making its edges blur. The class named as javafx.scene.effect.Shadow represents the shadow effect. We just need to instantiate this class to generate an appropriate shadow effect.

Properties

The properties of the class along with the setter methods are described in the following table.

PropertyDescriptionSetter Methods
blurTypeThis is a blur type property. This represents the algorithm which is used to blur the shadow.setBlurType(BlurType value)
colorThis is of color type property. It represents the shadow color.setColor(Color value)
heightIt represents the vertical size of the shadow blur.setHeight(double value)
inputIt represents the input for this effect.setInput(Effect value)
radiusIt represents the radius of the shadow.setRadius(double value)
widthIt represents the horizontal size of the shadow blur.setWidth(double value)

Constructors

The class contains three constructors.

  1. public Shadow() : Creates a new instance with the default parameters
  2. public Shadow(double radius, Color color) : Creates a new instance with the specified radius and color.
  3. public Shadow(BlurType blurtype, Color color, double radius) : Creates a new instance with the specified radius, color and blur type.

Example:


JavaFX Shadow Effect



Latest Courses