# getParentWindow in Custom Method

**URL:** <https://forum.inductiveautomation.com/t/getparentwindow-in-custom-method/39025>\
**Category:** Ignition\
**Tags:** ignition80, vision\
**Created:** [September 24, 2020, 2:51pm UTC](https://forum.inductiveautomation.com/t/getparentwindow-in-custom-method/39025 "2020-09-24T14:51:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jlandwerlen](https://avatars.discourse-cdn.com/v4/letter/j/bc8723/32.png) [@jlandwerlen](https://forum.inductiveautomation.com/u/jlandwerlen)\
**Post date:** [September 24, 2020, 2:51pm UTC](https://forum.inductiveautomation.com/t/getparentwindow-in-custom-method/39025/1 "2020-09-24T14:51:24Z")

</div>

Is there a way to get the parent window in a custom method, similar to system.gui.getParentWindow(event) without passing in a parameter?

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [September 24, 2020, 3:11pm UTC](https://forum.inductiveautomation.com/t/getparentwindow-in-custom-method/39025/2 "2020-09-24T15:11:11Z")

</div>

SwingUtils is your friend:

> [@onDoubleClick Extension Function](http://forum.inductiveautomation.com/t/ondoubleclick-extension-function/17961/10):
>
> Java’s [SwingUtilities](https://docs.oracle.com/javase/8/docs/api/javax/swing/SwingUtilities.html#getAncestorOfClass-java.lang.Class-java.awt.Component-) can help. Place the following in a script module, shared.swing, perhaps: from javax.swing import SwingUtilities from com.inductiveautomation.factorypmi.application import FPMIWindow def getParentWindow(component): return SwingUtilities.getAncestorOfClass(FPMIWindow, component) Then in your extension function, you can do: w = shared.swing.getParentWindow(self) v = w.rootContainer.customProperty

---

<div class="post-metadata">

**Author:** ![jlandwerlen](https://avatars.discourse-cdn.com/v4/letter/j/bc8723/32.png) [@jlandwerlen](https://forum.inductiveautomation.com/u/jlandwerlen)\
**Post date:** [September 24, 2020, 3:14pm UTC](https://forum.inductiveautomation.com/t/getparentwindow-in-custom-method/39025/3 "2020-09-24T15:14:28Z")

</div>

Thank you sir
