Menu

#8 Use of dual monitors are not handled correctly

open
nobody
5
2012-12-12
2011-12-02
Ken Händel
No

All frames are always restored on the primary screen.
Furthermore the saved coordinates refer to it.
This leads to a problem after restarting JSIDPlay2, where the window seem to disappear
(restored at an illegal position)

Example code for the UI creation:

private static void showOnScreen\(int screen, Window frame\) \{
    GraphicsEnvironment ge = GraphicsEnvironment
            .getLocalGraphicsEnvironment\(\);
    GraphicsDevice\[\] gs = ge.getScreenDevices\(\);
    if \(screen > -1 && screen < gs.length\) \{
        gs\[screen\].setFullScreenWindow\(frame\);
        JFrame f = new JFrame\(gs\[screen\].getDefaultConfiguration\(\)\);
    \} else if \(gs.length > 0\) \{
        JFrame f = new JFrame\(\);
    \} else \{
        throw new RuntimeException\("No Screens Found"\);
    \}
\}

Discussion