Introduction
JavaFX 3D shapes are geometrical figures that can be represented on the X, Y, and Z planes at the same time. The length or depth is represented by the X plane, the height by the Y plane, and the width by the Z plane. Cube, Cuboid, Cylinder, Cone, Sphere, and other general 3D shapes Shape3D class includes 3D shapes, and the Shape class includes all shapes (2D and 3D shapes).
JavaFX effects are graphical effects that can be applied to controls in a JavaFX application to improve the appearance of the application's GUI. The following effects are built into JavaFX:
- Drop Shadow
- Shadow
- BoxBlur
- GaussianBlur
- Reflection
- MotionBlur
- Bloom
- Glow
- SepiaTone
- DisplacementMap
- ColorInput
- ImageInput
- Blend
- Lighting
- PerspectiveTransform
JavaFX BoxBlur
JavaFX includes the BoxBlur class. BoxBlur blurs a node with a simple Box filter. Blur is implemented in JavaFX using BoxBlur. A blur effect is based on a simple box filter kernel, with size parameters in both dimensions and also an iteration parameter to control the quality of the resulting blur.
Example:
BoxBlur boxBlur = new BoxBlur();
boxBlur.setWidth(20);
boxBlur.setHeight(6);
boxBlur.setIterations(2);
Text message = new Text();
message.setText("Blurry Text!");
message.setFill(Color.web("0x3b596d"));
message.setFont(Font.font(null, FontWeight.BOLD, 50));
message.setX(10);
message.setY(50);
message.setEffect(boxBlur);
Properties
| Type | Property | Description |
| DoubleProperty | height | This represents the vertical dimension of the blur effect. |
| IntegerProperty | iterations | The number of times the blur effect has to iterate to improve its "quality" or "smoothness". |
| ObjectProperty<Effect> | input |
The input for this Effect.
|
| DoubleProperty | width |
The horizontal dimension of the blur effect.
|
Constructor
JavaFX BoxBlur has two constructors. Depending on the situation, it can be parameterized or non-parameterized.
- BoxBlur(): This creates a new instance of BoxBlur with all the parameters having a default value.
- BoxBlur(double width, double height, int iterations): This creates a new instance of BoxBlur with all the parameters having specified values for width, height, and iterations.
Methods
Java FlowPane has various methods that implement various functionalities. The most commonly used methods in FlowPane are.
| Modifier and type | Method | Description |
| DoubleProperty |
widthProperty()
|
The horizontal dimension of the blur effect.
|
| DoubleProperty |
heightProperty()
|
The vertical dimension of the blur effect. |
| double | getHeight() |
Gets the value of the property height.
|
| double | getWidth() | Gets the value of the property width. |
| void | setWidth() | Sets the value of the property width. |
| void |
setIterations(int value)
|
Sets the value of the property iterations.
|
| void | setHeight() | Sets the value of the property height. |
| void |
setInput(Effect value)
|
Sets the value of the property input.
|
| IntegerProperty |
iterationsProperty()
|
The number of times the blur effect has to iterate to improve its "quality" or "smoothness". |
|
ObjectProperty<Effect>
|
inputProperty()
|
The input for this Effect.
|
|
Effect
|
getInput()
|
Gets the value of the property input.
|







