applyStyleRuns

fun StyledDocument.applyStyleRuns(    stylesheet: Stylesheet,     runs: List<StyleRun>,     replace: Boolean = true)

Apply all style runs to the receiver, using the supplied stylesheet to obtain an appropriate rendering context for each run. Must be invoked on the Swing UI thread.

Parameters

stylesheet
runs

The style runs to apply to the document.

replace

Indicates whether or not the previous attributes should be cleared before the new attributes as set. If true, the operation will replace the previous attributes entirely. If false, the new attributes will be merged with the previous attributes.