showTextRange

fun JTextComponent.showTextRange(rangeStart: Int, rangeEnd: Int)

Scroll the given JTextPane to ensure the given text range is visible, and preferably not jammed against the top or bottom border.