# Popup window and Window size and location problem

**URL:** <https://forum.inductiveautomation.com/t/popup-window-and-window-size-and-location-problem/82243>\
**Category:** Ignition\
**Tags:** ignition81, vision\
**Created:** [November 22, 2023, 10:07am UTC](https://forum.inductiveautomation.com/t/popup-window-and-window-size-and-location-problem/82243 "2023-11-22T10:07:03Z")\
**Posts on this page:** 1\
**Showing post:** 27

<div class="post-metadata">

**Author:** ![justinedwards.jle](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justinedwards.jle/32/37854_2.png) [@justinedwards.jle](https://forum.inductiveautomation.com/u/justinedwards.jle)\
**Post date:** [November 22, 2023, 3:12pm UTC](https://forum.inductiveautomation.com/t/popup-window-and-window-size-and-location-problem/82243/27 "2023-11-22T15:12:09Z")

</div>

To resize it dynamically based on the parent window's session size, you will just have to get the parent window height, create a dimension, and adjust the popup's size. Integrating that into your existing code will look like this:

```auto
from java.awt import Dimension

# Get the parent window
parentWindow = system.gui.getParentWindow(event)

# Get the parent width and height
parentWidth = parentWindow.width
parentHeight = parentWindow.height

# Get and open the popup
popup = system.nav.openWindow('CM/Popup')

# Calculate the desired coordinates for the popup's position
x = parentWidth - popup.width # Far right of Main Window
y = 0 # Top of Main Window

# Position and resize the popup
popup.setLocation(x, y)
popup.setPreferredSize(Dimension(popup.width, parentHeight))
popup.setSize(Dimension(popup.width, parentHeight))

```

---

_[View the full topic](https://forum.inductiveautomation.com/t/popup-window-and-window-size-and-location-problem/82243)._
