<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSWindowController/showWindow(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSWindowController(im)showWindow:"
  },
  "title" : "showWindow(_:)"
}
-->

# showWindow(_:)

Displays the window associated with the receiver.

```
@IBAction func showWindow(_ sender: Any?)
```

## Parameters

`sender`

The control sending the message; can be `nil`.

## Discussion

If the window is an [`NSPanel`](/documentation/AppKit/NSPanel) object and has its [`becomesKeyOnlyIfNeeded`](/documentation/AppKit/NSPanel/becomesKeyOnlyIfNeeded) flag set to <doc://com.apple.documentation/documentation/Swift/true>, the window is displayed in front of all other windows but is not made key; otherwise it is displayed in front and is made key. This method is useful for menu actions.

## See Also

[`-  orderFront:`](/documentation/AppKit/NSWindow/orderFront(_:))

Moves the window to the front of its level in the screen list, without changing either the key window or the main window.

[`-  makeKeyAndOrderFront:`](/documentation/AppKit/NSWindow/makeKeyAndOrderFront(_:))

Moves the window to the front of the screen list, within its level, and makes it the key window; that is, it shows the window.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)