Class FlatLineBorder
java.lang.Object
javax.swing.border.AbstractBorder
javax.swing.border.EmptyBorder
javax.swing.plaf.BorderUIResource.EmptyBorderUIResource
com.formdev.flatlaf.ui.FlatEmptyBorder
com.formdev.flatlaf.ui.FlatLineBorder
- All Implemented Interfaces:
Serializable, Border, UIResource
- Direct Known Subclasses:
FlatListCellBorder, FlatPopupMenuBorder, FlatTableCellBorder
Line border for various components.
Paints a scaled (usually 1px thick) line around the component. The line thickness is not added to the border insets. The insets should be at least have line thickness (usually 1,1,1,1).
For JPanel and JLabel, this border
can be used paint rounded background (if line color is null) or
paint rounded line border with rounded background.
- See Also:
-
Field Summary
FieldsFields inherited from class EmptyBorder
bottom, left, right, top -
Constructor Summary
ConstructorsConstructorDescriptionFlatLineBorder(Insets insets, int arc) FlatLineBorder(Insets insets, Color lineColor) FlatLineBorder(Insets insets, Color lineColor, float lineThickness, int arc) -
Method Summary
Modifier and TypeMethodDescriptionintgetArc()Returns the (unscaled) arc diameter of the border corners.floatReturns the (unscaled) line thickness used to paint the border.voidpaintBorder(Component c, Graphics g, int x, int y, int width, int height) Methods inherited from class FlatEmptyBorder
applyStyleProperty, getBorderInsets, getBorderInsets, getStyleableValue, getUnscaledBorderInsets, scaleInsetsMethods inherited from class EmptyBorder
isBorderOpaqueMethods inherited from class AbstractBorder
getBaseline, getBaselineResizeBehavior, getBorderInsets, getInteriorRectangle, getInteriorRectangle
-
Field Details
-
lineColor
-
lineThickness
private final float lineThickness -
arc
private final int arc- Since:
- 2
-
-
Constructor Details
-
FlatLineBorder
-
FlatLineBorder
-
FlatLineBorder
- Since:
- 3.5
-
-
Method Details
-
getLineColor
-
getLineThickness
public float getLineThickness()Returns the (unscaled) line thickness used to paint the border. The line thickness does not affect the border insets. -
getArc
public int getArc()Returns the (unscaled) arc diameter of the border corners.- Since:
- 2
-
paintBorder
- Specified by:
paintBorderin interfaceBorder- Overrides:
paintBorderin classEmptyBorder
-