Home » JavaFX DropShadow Effect

JavaFX DropShadow Effect

by Online Tutorials Library

JavaFX DropShadow Effect

This effect is similar to the shadow effect. However, in DropShadow, the duplicate of the node is displayed behind the original node with the specified size and color. The class javafx.scene.effect.DropShadow is represents the DropShadow effect. We just need to instantiate this class in order to generate an appropriate effect.

Properties

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

Property Description Setter Methods
blurType This represents the algorithm used to blur the shadow. setBlurType(BlurType value)
setBlurType(BlurType value) The color of the shadow blur kernel. This property is of color type. setColor(Color value)
height This represents the height of the shadow blur kernel. This property is of double type. setHeight(Double value)
input This represents the input for the effect. setInput(Effect value)
offsetX This represents the X coordinate of the shadow offset. This properly is of double type. setOffsetX(Double value)
offsetY This represents the Y coordinate of the shadow offset. This property is of double type. setOffsetY(Double value)
Radius This represents the radius of the shadow blur kernel. setRadius(Double value)
Spread It represents the spread of the shadow blur kernel. Is is of double type. setSpread(Double value)
Width It represents the width of the shadow blur kernel. setWidth(double value)

Constructors

The class contains four constructors

  1. public DropShadow() : It creates the instance with the default parameters.
  2. public DropShadow(double radius, Color color) : It creates the instance with the specified radius and color values.
  3. public DropShadow(double radius, double offsetX, double offsetY, Color color) : It creates the instance with the specified radius, offset and color values.
  4. public DropShadow(BlurType blurtype, Color color, double radius, double spread, double offsetX, double offsetY) : It creates the instance with the specified BlurType, color, radius, spread and offset values.

Example:

JavaFX DropShadow Effect

You may also like