int pos = t.getCaret().getDot(); if (pos > t.getDocument().getStartPosition().getOffset())
int pos = t.getSelectionStart(); int len = t.getSelectionEnd() - pos;  if (len > 0)
      public void actionPerformed(ActionEvent event)      {        JTextComponent t = getTextComponent(event);        if (t != null)          {            try              {                int pos = t.getCaret().getDot();                if (pos > t.getDocument().getStartPosition().getOffset())                  {                    t.getDocument().remove(pos - 1, 1);                    t.getCaret().setDot(pos - 1);                  }              }            catch (BadLocationException e)              {                // FIXME: we're not authorized to throw this.. swallow it?              }          }      }