static void selectRange(final JTextComponent t, final int from, final int to) { swing { t.select(from, to); } }