private static void checkValidField( Field f )
		throws IllegalArgumentException
	{
		if( !isValidField( f ) )
			throw new IllegalArgumentException( "field '" + f.getDeclaringClass().getName() + "." + f.getName() + "' is final or static" );
	}
Applies the given value to a field of the given object.

@param obj the object
@param fieldName the name of the field
@param key the key (only used for error reporting)
@param value the new value
@return the old value of the field
@throws UnknownStyleException if object does not have a 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