JavaFX Reflection Effect
In general, Reflection can be defined as the change in the direction. JavaFX allows us to generate the reflection effect on any node. Reflection effect basically adds the reflection of the node to its bottom. It is represented by the class javafx.scene.effect.Reflection. We just need to instantiate this class in order to apply the appropriate effect to a node.
The properties of the class along with the setter methods are described in the following table.
||It is a double type property. It represents the opacity of the reflection at the bottom extreme.
||It is a double type property. It represents the fraction of the input that is to be displayed in the reflection.
||It is a object type property. It represents the input for the effect.
||It is a double type property. It represents the distance between the top and bottom of the reflection.
||It represents the opacity of the reflection at the top of the input.
The class contains two constructors.
- public Reflection() : Creates a new instance of Reflection with the default parameters
- public Reflection(double topOffset, double fraction, double topOpacity, double bottomOpacity) : Creates a new instance of Reflection with the specified parameters