t.getCaret().setDot(Math.min(t.getCaret().getDot() + 1, t.getDocument().getEndPosition() .getOffset()));
    public void actionPerformed(ActionEvent event)    {      // first we filter the following events:      // - control characters      // - key events with the ALT modifier (FIXME: filter that too!)      char c = event.getActionCommand().charAt(0);      if (Character.isISOControl(c))        return;      JTextComponent t = getTextComponent(event);      if (t != null)        {          try            {              t.getDocument().insertString(t.getCaret().getDot(),                                           event.getActionCommand(), null);              t.getCaret().setDot(Math.min(t.getCaret().getDot() + 1,                                           t.getDocument().getEndPosition()                                           .getOffset()));            }          catch (BadLocationException be)            {              // FIXME: we're not authorized to throw this.. swallow it?            }        }    }