else { if ( getFocusOwner() != null ) { KeyboardFocusManager.getCurrentKeyboardFocusManager().clearGlobalFocusOwner(); } }
    public void setFocusOwner( Component comp ) {        focusCleared = comp == null;        if ( comp != null ) {            for ( Container p = comp.getParent(); p != null; p = p.getParent() ) {                if ( p instanceof JInternalFrame ) {                    setFocusOwner( p );                }            }        }        if ( comp == null || comp.isFocusable() ) {            awtWindow.setFocusableWindowState( true );            Component oldFocusOwner = getFocusOwner();            if ( comp == desktop ) {                comp = null;            }            if ( oldFocusOwner != comp ) {                if ( oldFocusOwner != null ) {                    dispatchEvent( oldFocusOwner, new FocusEvent( oldFocusOwner,                            FocusEvent.FOCUS_LOST, false, comp ) );                }                if ( comp != null ) {                    dispatchEvent( comp, new FocusEvent( comp,                            FocusEvent.FOCUS_GAINED, false, oldFocusOwner ) );                }                else {                    if ( getFocusOwner() != null ) {                        KeyboardFocusManager.getCurrentKeyboardFocusManager().clearGlobalFocusOwner();                    }                }            }            awtWindow.setFocusableWindowState( false );        }    }