title: In Java, is it possible to listen for the connection/disconnection of an external Monitor?
body: <p>Upon disconnecting an external monitor from my laptop, I lose some of my apps as the disconnected monitor is still set as the default. Some of my windows are trying to display on the disconnected monitor.</p>
  
  <p>I have a workaround, such as right clicking on the app icon and selecting move then using the arrow key to move the windows to my laptop. I'm wondering if there is a way in Java to listen for the disconnect, then reset my default screen to my laptop.</p>
  
  <p>I thought about getting the number of and ID's of the screens that are available at startup and adding them to a property file. If a screen is disconnected, get the number of and ID's of the available screens again and compare those values to the values in my property file. I could then set the default to the screen that matches the new values and the stored values.</p>
  
  <p>I haven't started coding this up yet. This is more investigative than anything at this point.</p>