Basics
Guides
API Reference
Basics
Guides
API Reference
[50:7] extends: Node
Wraps JavaFX Line, a straight line segment between two points. Because a line has no interior area, the fill property has no visual effect. The stroke color defaults to black, which differs from other Shape subclasses.
| Property | Values | Default | Description |
|---|---|---|---|
-fx-fill |
<paint> |
null |
Fill paint. Has no visual effect on a line but is inherited from Shape. Default is null for Line. |
-fx-stroke |
<paint> |
black |
Color of the line stroke. Defaults to black for Line (unlike other shapes). |
| Property | Values | Default | Description |
|---|---|---|---|
-fx-smooth |
true | false |
true |
When true, anti-aliasing is applied to the shape edges. |
-fx-stroke-type |
inside | outside | centered |
centered |
Position of the stroke relative to the shape boundary. |
-fx-stroke-dash-array |
<size> [<size>]* |
(none) | Pattern of dashes and gaps for a dashed stroke. |
-fx-stroke-dash-offset |
<number> |
0 |
Offset into the dash pattern at which to begin rendering. |
-fx-stroke-line-cap |
square | butt | round |
square |
Style of the end caps on open path strokes. |
-fx-stroke-line-join |
miter | bevel | round |
miter |
Style used at corners where two stroke segments meet. |
-fx-stroke-miter-limit |
<number> |
10 |
Limit on the ratio of miter length to stroke width; beyond this the join becomes a bevel. |
-fx-stroke-width |
<size> |
1 |
Width of the shape stroke in pixels. |
| Property | Values | Default | Description |
|---|---|---|---|
-fx-blend-mode |
add | blue | color-burn | color-dodge | darken | difference | exclusion | green | hard-light | lighten | multiply | overlay | red | screen | soft-light | src-atop | src-in | src-out | src-over |
null |
Blend mode used when compositing this node with nodes beneath it. |
-fx-cursor |
null | crosshair | default | hand | move | e-resize | h-resize | ne-resize | nw-resize | n-resize | se-resize | sw-resize | s-resize | w-resize | v-resize | text | wait | <url> |
null (inherits) |
Mouse cursor shape shown when the pointer is over this node. Inherits from parent by default. |
-fx-effect |
<effect> |
null |
A visual effect (e.g. DropShadow, InnerShadow) applied to the rendered node. |
-fx-focus-traversable |
true | false |
false |
Whether this node participates in focus traversal. |
-fx-view-order |
<number> |
0 |
Adjusts rendering and hit-test order within the parent without changing the scene graph order. |
-fx-opacity |
<number> [0.0 - 1.0] |
1 |
Opacity of the node. 0 is fully transparent, 1 is fully opaque. |
-fx-rotate |
<number> |
0 |
Rotation angle in degrees applied around the node's center point. |
-fx-scale-x |
<number> |
1 |
Scale factor along the X axis about the node's center. |
-fx-scale-y |
<number> |
1 |
Scale factor along the Y axis about the node's center. |
-fx-scale-z |
<number> |
1 |
Scale factor along the Z axis about the node's center. |
-fx-translate-x |
<number> |
0 |
Translation offset along the X axis in pixels. |
-fx-translate-y |
<number> |
0 |
Translation offset along the Y axis in pixels. |
-fx-translate-z |
<number> |
0 |
Translation offset along the Z axis in pixels. |
visibility |
visible | hidden | collapse | inherit |
visible |
Controls whether the node is rendered and participates in layout. |
-fx-managed |
true | false |
true |
When false, the parent layout does not manage this node's position or size. |
Line (double StartX = 0.0, double StartY = 0.0, double EndX = 0.0, double EndY = 0.0)
Creates a new Line between the two specified endpoints.
StartX is a double with the X coordinate of the start point.StartY is a double with the Y coordinate of the start point.EndX is a double with the X coordinate of the end point.EndY is a double with the Y coordinate of the end point.setStartX (double X)
Sets the X coordinate of the line's start point.
X is a double with the new start X coordinate.this objectsetStartY (double Y)
Sets the Y coordinate of the line's start point.
Y is a double with the new start Y coordinate.this objectsetEndX (double X)
Sets the X coordinate of the line's end point.
X is a double with the new end X coordinate.this objectsetEndY (double Y)
Sets the Y coordinate of the line's end point.
Y is a double with the new end Y coordinate.this objectsetStroke (object PaintObj)
Sets the stroke paint for the line.
PaintObj is a paint object used to draw the line.this objectsetStrokeWidth (double W)
Sets the width of the line stroke.
W is a double with the stroke width in pixels.this object
Aussom
Write once. Embed everywhere.
Copyright 2026 Austin Lehman. All rights reserved.