static Rect textComponent_substringRect(final JTextComponent tc, final int startIndex, final int endIndex) { ret swing(func -> Rect { mergeRects(toRect(tc.modelToView(startIndex)), toRect(tc.modelToView(endIndex))) }); } static Rect textComponent_substringRect(final JTextComponent tc, IntRange charRange) { ret charRange == null ? null : textComponent_substringRect(tc, charRange.start, charRange.end); }