Class Border

java.lang.Object
javafx.scene.layout.Border

public final class Border extends Object
The border of a Region. A Border is an immutable object which encapsulates the entire set of data required to render the border of a Region. Because this class is immutable, you can freely reuse the same Border on many different Regions. Please refer to JavaFX CSS Reference Guide for a complete description of the CSS rules for styling the border of a Region.

Every Border is comprised of strokes and / or images. Neither list will ever be null, but either or both may be empty. When rendering, if no images are specified or no image succeeds in loading, then all strokes will be rendered in order. If any image is specified and succeeds in loading, then no strokes will be drawn, although they will still contribute to the insets and outsets of the Border.

The Border's outsets define any extension of the drawing area of a Region which is necessary to account for all border drawing and positioning. These outsets are defined by both the BorderStrokes and BorderImages specified on this Border. outsets are strictly non-negative.

insets are used to define the inner-most edge of all of the borders. It also is always strictly non-negative. The Region uses the insets of the Background and Border, and the Region's padding to determine the Region insets, which define the content area for any children of the Region. The outsets of a Border together with the outsets of a Background, and the width and height of the Region define the geometric bounds of the Region (which in turn contribute to the layoutBounds, boundsInLocal, and boundsInParent).

A Border is most often used in cases where you want to skin the Region with an image, often used in conjunction with 9-patch scaling techniques. In such cases, you may also specify a stroked border which is only used when the image fails to load for some reason.

Since:
JavaFX 8.0