2 つの別個のモニターに 2 つの JFrame を表示する Java アプリケーションがあります。Ubuntu と Windows では、アプリケーションは問題なく表示されます。指定した画面 ID でモニターに表示するように JFrame を構成できます。ただし、openSUSE では、設定に関係なく、同じモニターに表示され続けます。openSUSE との違いは何ですか?
JFrame を表示する必要があるモニターを決定するために使用するコードの一部を次に示します。
GraphicsDevice[] screens = GraphicsEnvironment.getLocalGraphicsEnvironment().getScreenDevices();
for (int s = 0; s < screens.length; s++) {
GraphicsConfiguration configuration = null;
for (int c = 0; c < 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);
}
}