static S wordAtMouse() { ret (S) swing(func { Component c = componentAtMouse(); if (c instanceof JTextComponent) { JTextComponent tc = cast c; Point d = mouseLocation(); SwingUtilities.convertPointFromScreen(d, c); int idx = tc.viewToModel(d); S text = tc.getText(); ret wordAroundIndex(text, idx); } ret ""; }); }