# Identify current monitor's (multiple) client size

**URL:** <https://forum.inductiveautomation.com/t/identify-current-monitors-multiple-client-size/33748>\
**Category:** Ignition\
**Created:** [April 7, 2020, 2:31pm UTC](https://forum.inductiveautomation.com/t/identify-current-monitors-multiple-client-size/33748 "2020-04-07T14:31:39Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jespinmartin1](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jespinmartin1/32/57175_2.png) [@jespinmartin1](https://forum.inductiveautomation.com/u/jespinmartin1)\
**Post date:** [April 7, 2020, 2:31pm UTC](https://forum.inductiveautomation.com/t/identify-current-monitors-multiple-client-size/33748/1 "2020-04-07T14:31:39Z")

</div>

I have a single client with multiple desktops-window opened in some monitors. I want to get the size (w,h) of each monitor, depending of the current monitor where the window appears.  
I’ve been testing some options but I don’t get into the correct one. I used `system.gui.getScreens()`, but I need to identify in a window script which is the index of the current monitor where this windows it’s been shown, but I don’t know how.  
I also tried with:  
`
from javax.swing import JFrame, SwingUtilities
window = system.gui.getParentWindow(event)
frame = SwingUtilities.getAncestorOfClass(JFrame, window)
width=frame.width
height=frame.height
`  
But I get the error  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/2X/8/8ca128dd97028ae466cd240ebcb12a34dbeb78b8.png)

also tried`
import java.awt
gd=java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice()
width = gd.getDisplayMode().getWidth()
height = gd.getDisplayMode().getHeight()
`  
But this one only gives the default monitor info. I wish `.getCurrentScreen() ` exists…

I also some other codes but I get errors or not desired behavior.

I need some advices please!!

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [April 7, 2020, 3:00pm UTC](https://forum.inductiveautomation.com/t/identify-current-monitors-multiple-client-size/33748/2 "2020-04-07T15:00:44Z")

</div>

Have you tried _system.gui.getScreenIndex()_ ?

---

<div class="post-metadata">

**Author:** ![jespinmartin1](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jespinmartin1/32/57175_2.png) [@jespinmartin1](https://forum.inductiveautomation.com/u/jespinmartin1)\
**Post date:** [April 7, 2020, 3:02pm UTC](https://forum.inductiveautomation.com/t/identify-current-monitors-multiple-client-size/33748/3 "2020-04-07T15:02:26Z")

</div>

I not sure how to use it. Please tell me how  
The documentation suggest this output is the index where the function was called. But where show I place the function on the root container of the window itself and which event handler show I use to trigger when ever the client moves between monitors?

---

<div class="post-metadata">

**Author:** ![jespinmartin1](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jespinmartin1/32/57175_2.png) [@jespinmartin1](https://forum.inductiveautomation.com/u/jespinmartin1)\
**Post date:** [April 7, 2020, 3:12pm UTC](https://forum.inductiveautomation.com/t/identify-current-monitors-multiple-client-size/33748/4 "2020-04-07T15:12:09Z")

</div>

ohh, now I understand, thanks for your suggest
