Single Vision Client on Multiple Monitors

I think this is possible but quite tricky... The main issue I think is that it is not possible to design a simple container without embedding it in a main or popup window.

For example the code below will "steal" the content of an existing window and show it an independent window with its own icon in the taskbar. I don't know if there is a better way or what are the consequences but this could get you started. Obviously I am pretty sure there are some drawbacks, but this could get you started... For this example I assume the window "About" exists and is opened. I have tested this only in the designer using the Script Playground.

from javax.swing import JFrame
from javax.swing import JDialog
dummyFrame = JFrame()
dummyFrame.setUndecorated(1)
dummyFrame.setVisible(1)
dummyFrame.setLocationRelativeTo(None)
dialog = JDialog(dummyFrame)
contentPane = system.gui.getWindow('About').rootContainer.getRootPane().getContentPane()
dialog.setContentPane(contentPane)
dialog.setSize(600,400)
dialog.setVisible(1)
1 Like