private static Field getStyleableField( StyleableField styleableField )
		throws IllegalArgumentException
	{
		String fieldName = styleableField.fieldName();
		if( fieldName.isEmpty() )
			fieldName = styleableField.key();

		try {
			return styleableField.cls().getDeclaredField( fieldName );
		} catch( NoSuchFieldException ex ) {
			throw new IllegalArgumentException( "field '" + styleableField.cls().getName() + "." + fieldName + "' not found", ex );
		}
	}
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