static Rect textComponent_substringRect(final JTextComponent tc, final int startIndex, int endIndex) { ret swing(func -> Rect { mergeRects(toRect(tc.modelToView(startIndex)), toRect(tc.modelToView(endIndex))) }); }