centerCurrentLine

fun JTextComponent.centerCurrentLine()

Center the current line of the receiver in its enclosing viewport by moving the caret. If no viewport encloses the receiver, then do not move the caret.