# Launching Application in second monitor

**URL:** <https://forum.inductiveautomation.com/t/launching-application-in-second-monitor/4990>\
**Category:** Ignition\
**Created:** [August 13, 2012, 3:08pm UTC](https://forum.inductiveautomation.com/t/launching-application-in-second-monitor/4990 "2012-08-13T15:08:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mdunnick](https://avatars.discourse-cdn.com/v4/letter/m/34f0e0/32.png) [@Mdunnick](https://forum.inductiveautomation.com/u/Mdunnick)\
**Post date:** [August 13, 2012, 3:08pm UTC](https://forum.inductiveautomation.com/t/launching-application-in-second-monitor/4990/1 "2012-08-13T15:08:35Z")

</div>

I have an application that launches in a second monitor that extends from the primary display in full screen. I have this application running on 12 HMI’s perfectly fine, however when it runs on a normal Desktop PC it tries to put the application in a third, non-available monitor.

Ignition seems to treat HMI’s as laptops with a built in display. Could this be the root cause of the issue? After about 10 times of minimizing then maximizing the application it then displays it in the correct monitor.

Here’s the script to making it start up on the second monitor.

[code]from javax.swing import SwingUtilities,JFrame  
from java.awt import Rectangle, GraphicsEnvironment, GraphicsDevice

ge = GraphicsEnvironment.getLocalGraphicsEnvironment()  
data = []  
for gd in ge.getScreenDevices(): #gets info of each monitor  
gb = gd.getDefaultConfiguration().getBounds() #gets cordinate screen starts at and the width/height of screen  
data.append([gb.x,gb.y,gb.width,gb.height]) #stores screen info in a list ([screen1], [screen2]

frame = SwingUtilities.getAncestorOfClass(JFrame, event.source)  
frame.setBounds(data[1][0], data[1][1], data[1][2], data[1][3]) #sets the area of the application to that of screens 2 bounds  
frame.dispose() #closes the window from view in order to remove the border of the frame - can’t do it while frame is visible  
frame.setUndecorated(True) #removes the border  
frame.setVisible(True)#makes the frame visible again

#removal of the MenuBar is done in the application configuration[/code]

---

<div class="post-metadata">

**Author:** ![greg.simpson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/greg.simpson/32/3135_2.png) [@greg.simpson](https://forum.inductiveautomation.com/u/greg.simpson)\
**Post date:** [August 13, 2012, 6:49pm UTC](https://forum.inductiveautomation.com/t/launching-application-in-second-monitor/4990/2 "2012-08-13T18:49:00Z")

</div>

Take a look at this and see if this helps

[viewtopic.php?f=81&t=6017](http://www.inductiveautomation.com/forum/viewtopic.php?f=81&t=6017)
