Class Rectangle

java.lang.Object
javafx.scene.Node
javafx.scene.shape.Shape
javafx.scene.shape.Rectangle
All Implemented Interfaces:
Styleable, EventTarget

public class Rectangle extends Shape
The Rectangle class defines a rectangle with the specified size and location. By default the rectangle has sharp corners. Rounded corners can be specified by setting both of the arcWidth and arcHeight properties to positive values (> 0.0).

Example code: the following code creates a rectangle with 20 pixel rounded corners.

import javafx.scene.shape.*;

Rectangle r = new Rectangle();
r.setX(50);
r.setY(50);
r.setWidth(200);
r.setHeight(100);
r.setArcWidth(20);
r.setArcHeight(20);
Since:
JavaFX 2.0