# Control the size and location of windowed vision client primary desktop

**URL:** <https://forum.inductiveautomation.com/t/control-the-size-and-location-of-windowed-vision-client-primary-desktop/37535>\
**Category:** Ignition\
**Created:** [August 10, 2020, 12:07am UTC](https://forum.inductiveautomation.com/t/control-the-size-and-location-of-windowed-vision-client-primary-desktop/37535 "2020-08-10T00:07:03Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![franklepkowski](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/franklepkowski/32/4808_2.png) [@franklepkowski](https://forum.inductiveautomation.com/u/franklepkowski)\
**Post date:** [August 10, 2020, 12:07am UTC](https://forum.inductiveautomation.com/t/control-the-size-and-location-of-windowed-vision-client-primary-desktop/37535/1 "2020-08-10T00:07:03Z")

</div>

Hi All,

I am wondering how to manipulate both the size and the location of a windowed vision client. This client will be opened on a 4K display and I would like it to occupy the upper right corner of the display. This is easily done with additional desktops using the sys.gui.openDesktop but in this case I just have the one which is the primary desktop. I am unsure if I can do something to do this in a client startup script or if I can do it by passing JVM arguments in the client launcher. Any information is appreciated.

Thanks,

Frank

---

<div class="post-metadata">

**Author:** ![witman](https://avatars.discourse-cdn.com/v4/letter/w/d2c977/32.png) [@witman](https://forum.inductiveautomation.com/u/witman)\
**Post date:** [August 10, 2020, 2:14am UTC](https://forum.inductiveautomation.com/t/control-the-size-and-location-of-windowed-vision-client-primary-desktop/37535/2 "2020-08-10T02:14:51Z")

</div>

Adding something like this in the client startup script where `"PathToWindow"` is the desired window should work:

```python
from javax.swing import JFrame

# Size and position windowed vision client primary desktop to top right quadrant of 4K display.
desktop = system.nav.openWindow("PathToWindow")
while not isinstance(desktop, JFrame):
	desktop = desktop.getParent()
desktop.setSize(1920,1080)
desktop.setLocation(1920,0)

```

---

<div class="post-metadata">

**Author:** ![franklepkowski](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/franklepkowski/32/4808_2.png) [@franklepkowski](https://forum.inductiveautomation.com/u/franklepkowski)\
**Post date:** [August 11, 2020, 7:33pm UTC](https://forum.inductiveautomation.com/t/control-the-size-and-location-of-windowed-vision-client-primary-desktop/37535/3 "2020-08-11T19:33:30Z")

</div>

This throws an error JFrame is not defined.

---

<div class="post-metadata">

**Author:** ![witman](https://avatars.discourse-cdn.com/v4/letter/w/d2c977/32.png) [@witman](https://forum.inductiveautomation.com/u/witman)\
**Post date:** [August 11, 2020, 7:37pm UTC](https://forum.inductiveautomation.com/t/control-the-size-and-location-of-windowed-vision-client-primary-desktop/37535/4 "2020-08-11T19:37:12Z")

</div>

The code above is now edited to include necessary import.
