2
votes

I have a Java application that displays two JFrames on two separate monitors. On Ubuntu and Windows the application displays just fine. I can configure the JFrames to display on the monitors with the specified screen ID. However on openSUSE it keeps displaying on the same monitor regardless of the setting. What is different to openSUSE?

Here is some of the code that I use to determine on which monitor the JFrame must display:


    GraphicsDevice[] screens = GraphicsEnvironment.getLocalGraphicsEnvironment().getScreenDevices();
    for (int s = 0; s &lt screens.length; s++) {
        GraphicsConfiguration configuration = null;
        for (int c = 0; c &lt screens[s].getConfigurations().length; c++) {
            if (AWTUtilities.isTranslucencyCapable(screens[s].getConfigurations()[c])) {
                configuration = screens[s].getConfigurations()[c];
                break;
            }
        }
        if (configuration == null) {
            configuration = screens[s].getDefaultConfiguration();
        }
        if (screens[s].getIDstring().equals[frame1_id]) {
            frame1 = new JFrame("Frame 1", configuration);
            frame1.setResizable(false);
            frame1.setUndecorated(true);
            frame1.setBounds(configuration.getBounds());
            frame1.setVisible(true);
        }
        if (screens[s].getIDstring().equals[frame2_id]) {
            frame2 = new JFrame("Frame 2", configuration);
            frame2.setResizable(false);
            frame2.setUndecorated(true);
            frame2.setBounds(configuration.getBounds());
            frame2.setVisible(true);
        }
    }
1
Have you tried a different window manager? - trashgod
That worked for me, thank you very much. Please add your comment as an answer so that I can up vote it. - bouncer
Glad it helped. If you have details on what worked best, I'll incorporate them in the answer. You can also answer your own question. - trashgod

1 Answers

1
votes

The OpenSuse implementation of GraphicsEnvironment may depend on the choice of a particular window manager. You'll have to experiment to find the optimal one.

Addendum: @bouncer comments, "I have used the Gnome window manager, which caused the problem. After switching to KDE, the problem was solved." See also 10 things to do after installing openSUSE 12.3.