86
JavaFX Box
In general, a box can be defined as the three dimensional shape having all the faces in the rectangular shape. Boxes are generally the cuboid having three dimensions height, depth and width. In JavaFX, box is represented by the class javafx.scene.shape.Box. We just need to instantiate this class in order to create the box.
The height, width and depth of a cube (box) is shown in the following image.
Properties
The class contains various properties that are described in the following table.
Property | Description | Setter Methods |
---|---|---|
depth | It is a double type property. It represents the z-dimension of the Box. | setDepth(double value) |
height | It is a double type property. It represents the Y-dimension of the Box. | setHeight(double value) |
width | It is a double type property. It represents the X-dimension of the Box. | setWidth(double value) |
Constructors
The class contains two constructors described below.
- public Box(): creates the instance of Box class with the default parameters.
- public Box(double width, double height, double depth) : creates the instance of Box class with the specified dimensions
Example
Next TopicJavaFX Cylinder