@Override
	public void paintBorder( Component c, Graphics g, int x, int y, int width, int height ) {
		if( c instanceof JComponent && ((JComponent)c).getClientProperty( FlatPopupFactory.KEY_POPUP_USES_NATIVE_BORDER ) != null )
			return;

		Color lineColor = getLineColor();
		float lineThickness = getLineThickness();
		if( lineColor == null || lineThickness <= 0 )
			return;

		int arc = getArc();
		if( arc < 0 ) {
			// get arc from label or panel
			ComponentUI ui = (c instanceof JLabel)
				? ((JLabel)c).getUI()
				: (c instanceof JPanel ? ((JPanel)c).getUI() : null);
			if( ui instanceof FlatLabelUI )
				arc = ((FlatLabelUI)ui).arc;
			else if( ui instanceof FlatPanelUI )
				arc = ((FlatPanelUI)ui).arc;

			if( arc < 0 )
				arc = 0;
		}

		Graphics2D g2 = (Graphics2D) g.create();
		try {
			FlatUIUtils.setRenderingHints( g2 );
			FlatUIUtils.paintOutlinedComponent( g2, x, y, width, height,
				0, 0, 0, scale( lineThickness ), scale( arc ), null, lineColor, null );
		} finally {
			g2.dispose();
		}
	}
Returns the (unscaled) arc diameter of the border corners.

@since 2
flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatLineBorder.java