2D Objects Properties - Stroke Line Cap


Advertisements

This property is of the type StrokeLineCap It represents the end cap style of the line. You can set the line cap stroke using the method setStrokeLineCap() as shown in the following code block −

line.setStrokeLineCap(StrokeLineCap.SQUARE);

The stroke line cap can be −

  • Butt − The butt line cap is applied at the end of the lines (StrokeLineCap.BUTT).

  • Square − The square line cap is applied at the end of the lines (StrokeLineCap.SQUARE).

  • Round − The round line cap is applied at the end of the lines (StrokeLineCap.ROUND).

By default, the Stroke Line cap a shape is square. Following is the diagram of a triangle with different line cap types.

Stroke Line Cap
javafx_2d_shapes.htm
Advertisements