void (VisibleAreaEvent e) { if (myAppleRepaintAlarm == null) { myAppleRepaintAlarm = new Alarm(Alarm.ThreadToUse.SWING_THREAD); } myAppleRepaintAlarm.cancelAllRequests(); myAppleRepaintAlarm.addRequest(new Runnable() { public void run() { repaint(0, myDocument.getTextLength()); } }, 50, ModalityState.stateForComponent(myEditorComponent)); }