!7 p-experiment { S text = lines(sentencesAfterLines_withPeriodOnly(mechList_raw("Simple Wikipedia: Peafowl"))); //jtextpane(text) JTextPane tp = swing(func -> JTextPane { ret new JTextPane { public void paint(Graphics _g) { Graphics2D g = cast _g; super.paint(g); pcall { S text = getText(); L tok = javaTok(text); int i = tokenToCharIndex(tok, indexOfIC(tok, "it")); if (i >= 0) { Rect r = mergeRects( Rect(modelToView(i)), Rect(modelToView(i+2))); drawRect(g, r.x, r.y, r.w, r.h, Color.green); } } } }; }); setText(tp, text); showFrame(setFontSize(18, tp)); L tok = javaTok(text); }