Full Screen Exclusive Mode on multiple monitors
I want a full screen exclusive mode window/frame/jframe on two monitors - where each screen has its own exclusive mode display. My graphics environment detects two graphic devices. I create a full screen exclusive mode display for each graphic configuration. The following scenarios occur depending on user actions:
scenario 1 [user lets the program run without interferring]: the display for the first graphics device comes up (a yellow display on screen 1) and then the display for the second graphics device (a blue display) overlaps the first (yellow) display - my thoughts: I didn't expect the blue display to overlap the yellow display.
scenario 2 [when running program, after the yellow display comes up, the user clicks somewhere on the second screen (causing the yellow display to iconify) before the blue screen comes up]: Because of user action, the blue display shows up on the second screen - my thoughts: why did it take the iconification of the yellow display to place the blue display on the correct screen?
Here is the code that I used to test this:
public class TestMultiScreens {
public static void main(String[] argv) {
TestMultiScreens t = new TestMultiScreens();
t.go();
}
public void go() {
try {
GraphicsDevice[] gd = GraphicsEnvironment.
getLocalGraphicsEnvironment().getScreenDevices();
JFrame f1 = new JFrame("one");
JDesktopPane desktopPane1 = new JDesktopPane();
desktopPane1.setOpaque(true);
desktopPane1.setBackground(Color.yellow);
f1.setContentPane(desktopPane1);
System.out.println("gd[0] = " + gd[0].toString());
System.out.println("bounds = " + gd[0].getDefaultConfiguration().getBounds().toString());
gd[0].setFullScreenWindow(f1);
try {
Thread.sleep(3000);
} catch (InterruptedException ie) {
}
JFrame f2 = new JFrame("two");
JDesktopPane desktopPane2 = new JDesktopPane();
desktopPane2.setOpaque(true);
desktopPane2.setBackground(Color.blue);
f2.setContentPane(desktopPane2);
System.out.println("gd[1] = " + gd[1].toString());
System.out.println("bounds = " + gd[1].getDefaultConfiguration().getBounds().toString());
gd[1].setFullScreenWindow(f2);
try {
Thread.sleep(3000);
} catch (InterruptedException ie) {
}
} catch (Exception e) {
e.printStackTrace();
}
System.exit(0);
}
}
Overall, it does not look like full screen exclusive mode supports multi-screens. Plus, it is odd that they iconify when focus is lost on the display.
Any thoughts?

