public void enableInputMethods(boolean enable){
  if (enable) {
    if ((eventMask & AWTEvent.INPUT_METHODS_ENABLED_MASK) != 0)     return;
    if (isFocusOwner()) {
      InputContext inputContext=getInputContext();
      if (inputContext != null) {
        FocusEvent focusGainedEvent=new FocusEvent(this,FocusEvent.FOCUS_GAINED);
        inputContext.dispatchEvent(focusGainedEvent);
      }
    }
    eventMask|=AWTEvent.INPUT_METHODS_ENABLED_MASK;
  }
 else {
    if ((eventMask & AWTEvent.INPUT_METHODS_ENABLED_MASK) != 0) {
      InputContext inputContext=getInputContext();
      if (inputContext != null) {
        inputContext.endComposition();
        inputContext.removeNotify(this);
      }
    }
    eventMask&=~AWTEvent.INPUT_METHODS_ENABLED_MASK;
  }
}

public void enableInputMethods ( boolean enable ) { if ( enable ) { if ( ( eventMask & AWTEvent . INPUT_METHODS_ENABLED_MASK ) != 0 ) return ; if ( isFocusOwner ( ) ) { InputContext inputContext = getInputContext ( ) ; if ( inputContext != null ) { FocusEvent focusGainedEvent = new FocusEvent ( this , FocusEvent . FOCUS_GAINED ) ; inputContext . dispatchEvent ( focusGainedEvent ) ; } } eventMask |= AWTEvent . INPUT_METHODS_ENABLED_MASK ; } else { if ( ( eventMask & AWTEvent . INPUT_METHODS_ENABLED_MASK ) != 0 ) { InputContext inputContext = getInputContext ( ) ; if ( inputContext != null ) { inputContext . endComposition ( ) ; inputContext . removeNotify ( this ) ; } } eventMask &= ~ AWTEvent . INPUT_METHODS_ENABLED_MASK ; } }
enables or disables input method support for this component . if input method support is enabled and the component also processes key events , incoming events are offered to the current input method and will only be processed by the component or dispatched to its listeners if the input method does not consume them . by default , input method support is enabled .
