if (event.getSource() instanceof JTextComponent) return (JTextComponent) event.getSource();  return getFocusedComponent();
JTextComponent target = null; if (event != null) { Object source = event.getSource(); if (source instanceof JTextComponent) target = (JTextComponent) source; } if (target == null) target = getFocusedComponent(); return target;
  protected final JTextComponent getTextComponent(ActionEvent event)  {    if (event.getSource() instanceof JTextComponent)      return (JTextComponent) event.getSource();      return getFocusedComponent();  }