static Object applyToAnnotatedObjectOrBorder( Object obj, String key, Object value,
		JComponent c, AtomicBoolean borderShared )
			throws IllegalArgumentException
	{
		try {
			return applyToAnnotatedObject( obj, key, value );
		} catch( UnknownStyleException ex ) {
			// apply to border
			Border border = c.getBorder();
			if( border instanceof StyleableBorder ) {
				if( borderShared.get() ) {
					border = cloneBorder( border );
					c.setBorder( border );
					borderShared.set( false );
				}

				try {
					return ((StyleableBorder)border).applyStyleProperty( key, value );
				} catch( UnknownStyleException ex2 ) {
					// ignore
				}
			}

			// apply to component property
			try {
				return applyToProperty( c, key, value );
			} catch( UnknownStyleException ex2 ) {
				// ignore
			}
			throw ex;
		}
	}
Applies the given value to an annotated field of the given object
or to a property of the given component.
The field must be annotated with {@link Styleable}.
The component property must have public getter and setter methods.

@param obj the object
@param comp the component, or {@code null}
@param key the name of the field
@param value the new value
@return the old value of the field
@throws UnknownStyleException if object does not have an annotated field with given name
@throws IllegalArgumentException if value type does not fit to expected type
flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatStylingSupport.java