Most of our clients are displayed on multiple monitors. One setup in particular uses a TV connected with miracast (basically a wireless monitor) to display OEE on the plant floor.
Operators will open the display on a laptop and edit run totals, targets, etc for the day then move the client to the TV, which is running in ‘Extend’ display mode (rather than mirroring displays, since the laptop resolution is smaller than the display and TV). Moving the windows between displays is done using the system.gui.getScreens() to populate active displays, and using system.gui.setScreenIndex() to swap.
My problem occurs when the operator either:
a) does not connect to the TV display prior to opening the client
b) the TV loses connection (someone moves or closes the laptop).
c) operator changes to mirrored mode to edit, then back to extended
Unless I reboot the client, trying to move windows to the TV simply drops them in the primary display. system.gui.getScreens() seems to recognize both displays reliably, but windows refuse to move to the TV.
Is there any way to retrieve a current/valid list of displays if the client is already initialized? I have tried using GraphicsEnvironment.getLocalGraphicsEnvironment().getScreenDevices() but it suffers from the same issue.
Thanks for your time.