# Open window in a new location

**URL:** <https://forum.inductiveautomation.com/t/open-window-in-a-new-location/232>\
**Category:** Archived Topics\
**Created:** [March 3, 2007, 4:41am UTC](https://forum.inductiveautomation.com/t/open-window-in-a-new-location/232 "2007-03-03T04:41:20Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![clark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/clark/32/2_2.png) [@clark](https://forum.inductiveautomation.com/u/clark)\
**Post date:** [March 3, 2007, 4:41am UTC](https://forum.inductiveautomation.com/t/open-window-in-a-new-location/232/1 "2007-03-03T04:41:20Z")

</div>

How can I specify where a new window opens? It seems like openWindow() only places a window where it was last saved in the designer.

---

<div class="post-metadata">

**Author:** ![nathan](https://avatars.discourse-cdn.com/v4/letter/n/c5a1d2/32.png) [@nathan](https://forum.inductiveautomation.com/u/nathan)\
**Post date:** [March 3, 2007, 2:53pm UTC](https://forum.inductiveautomation.com/t/open-window-in-a-new-location/232/2 "2007-03-03T14:53:29Z")

</div>

Clark,  
This is best accomplished in 2 steps. openWindow() will return a reference to the window opened. You can then call setLocation(x,y) on it.

```auto
x=50
y=100
window = fpmi.gui.openWindow('My Popup Window')
window.setLocation(x,y)
```

---

<div class="post-metadata">

**Author:** ![clark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/clark/32/2_2.png) [@clark](https://forum.inductiveautomation.com/u/clark)\
**Post date:** [March 3, 2007, 3:01pm UTC](https://forum.inductiveautomation.com/t/open-window-in-a-new-location/232/3 "2007-03-03T15:01:57Z")

</div>

It worked! I made a window for fun that used numeric labels to set the x and y position, used a dropdown list to select the window then had a button to open the selected window at the user defined location.

---

<div class="post-metadata">

**Author:** ![nathan](https://avatars.discourse-cdn.com/v4/letter/n/c5a1d2/32.png) [@nathan](https://forum.inductiveautomation.com/u/nathan)\
**Post date:** [March 3, 2007, 3:26pm UTC](https://forum.inductiveautomation.com/t/open-window-in-a-new-location/232/4 "2007-03-03T15:26:02Z")

</div>

A few other Java object fucntion options from [here (1.4.2)](http://java.sun.com/j2se/1.4.2/docs/api/java/awt/Component.html) or [here (1.5.0)](http://java.sun.com/j2se/1.5.0/docs/api/java/awt/Component.html)

setBounds(int x, int y, int width, int height) - Moves and resizes this component.

setLocation(int x, int y) - Moves this component to a new location.

setSize(int width, int height) - Resizes this component so that it has width width and height height.

setVisible(boolean b) - Shows or hides this component depending on the value of parameter b.

There are many other similar isFunctions() and getFunctions()
