private void applyProperties( Properties properties ) {
		if( jsonUI == null )
			return;

		put( properties, "Component.isIntelliJTheme", "true" );

		// enable button shadows
		put( properties, "Button.paintShadow", "true" );
		put( properties, "Button.shadowWidth", dark ? "2" : "1" );

		Map<String, String> themeSpecificProps = removeThemeSpecificProps( properties );
		Set<String> jsonUIKeys = new HashSet<>();

		// Json node "colors"
		loadNamedColors( properties, jsonUIKeys );

		// convert Json "ui" structure to UI properties
		for( Map.Entry<String, Object> e : jsonUI.entrySet() )
			apply( e.getKey(), e.getValue(), properties, jsonUIKeys );

		// set FlatLaf variables
		copyIfSetInJson( properties, jsonUIKeys, "@background", "Panel.background", "*.background" );
		copyIfSetInJson( properties, jsonUIKeys, "@foreground", "CheckBox.foreground", "*.foreground" );
		copyIfSetInJson( properties, jsonUIKeys, "@accentBaseColor",
			"ColorPalette.accent", // Material UI Lite, Hiberbee
			"ColorPalette.accentColor", // Dracula, One Dark
			"ProgressBar.foreground",
			"*.selectionBackground" );
		copyIfSetInJson( properties, jsonUIKeys, "@accentUnderlineColor", "*.underlineColor", "TabbedPane.underlineColor" );
		copyIfSetInJson( properties, jsonUIKeys, "@selectionBackground", "*.selectionBackground" );
		copyIfSetInJson( properties, jsonUIKeys, "@selectionForeground", "*.selectionForeground" );
		copyIfSetInJson( properties, jsonUIKeys, "@selectionInactiveBackground", "*.selectionInactiveBackground" );
		copyIfSetInJson( properties, jsonUIKeys, "@selectionInactiveForeground", "*.selectionInactiveForeground" );

		// Json node "icons/ColorPalette"
		applyIconsColorPalette( properties );

		// apply "CheckBox.icon." colors
		applyCheckBoxColors( properties );

		// copy values
		for( Map.Entry<String, String> e : uiKeyCopying.entrySet() ) {
			Object value = properties.get( e.getValue() );
			if( value != null )
				put( properties, e.getKey(), value );
		}

		// IDEA does not paint button background if disabled, but FlatLaf does
		put( properties, "Button.disabledBackground", "@disabledBackground" );
		put( properties, "ToggleButton.disabledBackground", "@disabledBackground" );

		// fix Button
		fixStartEnd( properties, jsonUIKeys, "Button.startBackground", "Button.endBackground", "Button.background" );
		fixStartEnd( properties, jsonUIKeys, "Button.startBorderColor", "Button.endBorderColor", "Button.borderColor" );
		fixStartEnd( properties, jsonUIKeys, "Button.default.startBackground", "Button.default.endBackground", "Button.default.background" );
		fixStartEnd( properties, jsonUIKeys, "Button.default.startBorderColor", "Button.default.endBorderColor", "Button.default.borderColor" );

		// IDEA uses TextField.background for editable ComboBox and Spinner
		Object textFieldBackground = get( properties, themeSpecificProps, "TextField.background" );
		put( properties, "ComboBox.editableBackground", textFieldBackground );
		put( properties, "Spinner.background", textFieldBackground );

		// some themes specify colors for TextField.background, but forget to specify it for other components
		// (probably because those components are not used in IntelliJ IDEA)
		putAll( properties, textFieldBackground,
			"EditorPane.background",
			"FormattedTextField.background",
			"PasswordField.background",
			"TextArea.background",
			"TextPane.background"
		);
		putAll( properties, get( properties, themeSpecificProps, "TextField.selectionBackground" ),
			"EditorPane.selectionBackground",
			"FormattedTextField.selectionBackground",
			"PasswordField.selectionBackground",
			"TextArea.selectionBackground",
			"TextPane.selectionBackground"
		);
		putAll( properties, get( properties, themeSpecificProps, "TextField.selectionForeground" ),
			"EditorPane.selectionForeground",
			"FormattedTextField.selectionForeground",
			"PasswordField.selectionForeground",
			"TextArea.selectionForeground",
			"TextPane.selectionForeground"
		);

		// fix disabled and not-editable backgrounds for text components, combobox and spinner
		// (IntelliJ IDEA does not use those colors; instead it used background color of parent)
		putAll( properties, "@disabledBackground",
			"ComboBox.disabledBackground",
			"EditorPane.disabledBackground", "EditorPane.inactiveBackground",
			"FormattedTextField.disabledBackground", "FormattedTextField.inactiveBackground",
			"PasswordField.disabledBackground", "PasswordField.inactiveBackground",
			"Spinner.disabledBackground",
			"TextArea.disabledBackground", "TextArea.inactiveBackground",
			"TextField.disabledBackground", "TextField.inactiveBackground",
			"TextPane.disabledBackground", "TextPane.inactiveBackground"
		);

		// fix DesktopPane background (use Panel.background and make it 5% darker/lighter)
		put( properties, "Desktop.background", dark ? "lighten($Panel.background,5%)" : "darken($Panel.background,5%)" );

		// limit tree row height
		String rowHeightStr = (String) properties.get( "Tree.rowHeight" );
		int rowHeight = (rowHeightStr != null) ? Integer.parseInt( rowHeightStr ) : 0;
		if( rowHeight > 22 )
			put( properties, "Tree.rowHeight", "22" );

		// get (and remove) theme specific wildcard replacements, which override all other properties that end with same suffix
		HashMap<String, String> wildcardProps = new HashMap<>();
		Iterator<Map.Entry<String, String>> it = themeSpecificProps.entrySet().iterator();
		while( it.hasNext() ) {
			Map.Entry<String, String> e = it.next();
			String key = e.getKey();
			if( key.startsWith( "*." ) ) {
				wildcardProps.put( key, e.getValue() );
				it.remove();
			}
		}

		// override properties with theme specific wildcard replacements
		if( !wildcardProps.isEmpty() ) {
			for( Map.Entry<String, String> e : wildcardProps.entrySet() )
				applyWildcard( properties, e.getKey(), e.getValue() );
		}

		// apply theme specific properties at the end to allow overwriting
		for( Map.Entry<String, String> e : themeSpecificProps.entrySet() ) {
			String key = e.getKey();
			String value = e.getValue();

			// append styles to existing styles
			if( key.startsWith( "[style]" ) ) {
				String oldValue = (String) properties.get( key );
				if( oldValue != null )
					value = oldValue + "; " + value;
			}

			put( properties, key, value );
		}

		// let Java release memory
		jsonColors = null;
		jsonUI = null;
		jsonIcons = null;
	}
Loads a IntelliJ .theme.json file from the given input stream.

The input stream is automatically closed.
Using a buffered input stream is not necessary.
flatlaf-core/src/main/java/com/formdev/flatlaf/IntelliJTheme.java