if (containsFocus()) {
autoTransferFocus(true);
}
ComponentPeer peer = this.peer;
if (peer != null) {
peer.hide();
createHierarchyEvents(HierarchyEvent.HIERARCHY_CHANGED,
this, parent,
HierarchyEvent.SHOWING_CHANGED,
Toolkit.enabledOnToolkit(AWTEvent.HIERARCHY_EVENT_MASK));
if (peer instanceof LightweightPeer) {