I want to make such an object, and put on it a blur according to Gauss

Approximately what you need

2 answers 2

In order to round the corners of a rectangle, it is enough just to call the appropriate class methods.

If you follow the documentation , you can see that the parameters are responsible for the rounding:

arcWidth — defines the horizontal diameter of the arc at the four corners of the rectangle. arcHeight — defines the vertical diameter of the arc at the four corners of the rectangle.

They can be set via setArcWidth and setArcHeight respectively.

 Rectangle rect = new Rectangle(110, 110, 200, 200); rect.setArcWidth(20); rect.setArcHeight(20); rect.setStroke(Color.GREEN); rect.setStrokeWidth(10); 

If Canvas used, then when drawing, you can specify these parameters directly in the designer with the 5th and 6th parameters:

 GraphicsContext gc = canvas.getGraphicsContext2D(); gc.setFill(Color.RED); gc.fillRoundRect(50, 50, 100, 100, 30, 30); 

    It is possible to use css : -fx-border-radius and -fx-border-insets