protected void processHierarchyEvent(HierarchyEvent evt){
  super.processHierarchyEvent(evt);
  if ((evt.getChangeFlags() & HierarchyEvent.SHOWING_CHANGED) == HierarchyEvent.SHOWING_CHANGED) {
    boolean showing=isShowing();
    if (!showing && popup != null)     hidePopup();
 else     if (showing && popup == null && showPending)     autoCompleteInput();
  }
}

protected void processHierarchyEvent ( HierarchyEvent evt ) { super . processHierarchyEvent ( evt ) ; if ( ( evt . getChangeFlags ( ) & HierarchyEvent . SHOWING_CHANGED ) == HierarchyEvent . SHOWING_CHANGED ) { boolean showing = isShowing ( ) ; if ( ! showing && popup != null ) hidePopup ( ) ; else if ( showing && popup == null && showPending ) autoCompleteInput ( ) ; } }
ensures the popup gets hidden if this text - box is hidden and that the popup is shown if a previous show is pending ( from trying to autocomplete while it wasn ' t visible ) .
