-
Bug
-
Resolution: Duplicate
-
P2
-
None
-
7
-
x86
-
windows_xp
Problem is the same as described in 6838089, 6838942.
Please see the following code:
------------------------------
import javax.swing.*;
import java.awt.*;
import static java.lang.System.out;
public class SettingBackground {
public static void main(String[] args) {
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
GraphicsDevice[] devices = ge.getScreenDevices();
Frame window = new Frame("My frame");
window.setBackground(Color.RED);
GraphicsDevice device = devices[0];
out.println("using device " + device);
device.setFullScreenWindow(window);
out.println("device.getFullScreenWindow() = " + device.getFullScreenWindow());
try {
window.setBackground(new Color(30,30,30,100));
System.out.println("No IllegalComponentStateException");
GraphicsConfiguration gc = window.getGraphicsConfiguration();
out.println("device = " + gc.getDevice());
out.println("device.getFullScreenWindow() = " + gc.getDevice().getFullScreenWindow());
// onbe can see elliptical shape of the window
Thread.sleep(1000);
} catch (IllegalComponentStateException e) {
System.out.println("OK - IllegalComponentStateException thrown");
} catch (InterruptedException e) {
} finally {
window.dispose();
}
}
});
}
}
------------------------------
On two-monitor configuration it prints out:
using device Win32GraphicsDevice[screen=0]
device.getFullScreenWindow() = java.awt.Frame[frame0,1280,0,1280x1024,layout=java.awt.BorderLayout,title=My frame,resizable,normal]
No IllegalComponentStateException
device = Win32GraphicsDevice[screen=1]
device.getFullScreenWindow() = null
------------------------------
Please see the following code:
------------------------------
import javax.swing.*;
import java.awt.*;
import static java.lang.System.out;
public class SettingBackground {
public static void main(String[] args) {
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
GraphicsDevice[] devices = ge.getScreenDevices();
Frame window = new Frame("My frame");
window.setBackground(Color.RED);
GraphicsDevice device = devices[0];
out.println("using device " + device);
device.setFullScreenWindow(window);
out.println("device.getFullScreenWindow() = " + device.getFullScreenWindow());
try {
window.setBackground(new Color(30,30,30,100));
System.out.println("No IllegalComponentStateException");
GraphicsConfiguration gc = window.getGraphicsConfiguration();
out.println("device = " + gc.getDevice());
out.println("device.getFullScreenWindow() = " + gc.getDevice().getFullScreenWindow());
// onbe can see elliptical shape of the window
Thread.sleep(1000);
} catch (IllegalComponentStateException e) {
System.out.println("OK - IllegalComponentStateException thrown");
} catch (InterruptedException e) {
} finally {
window.dispose();
}
}
});
}
}
------------------------------
On two-monitor configuration it prints out:
using device Win32GraphicsDevice[screen=0]
device.getFullScreenWindow() = java.awt.Frame[frame0,1280,0,1280x1024,layout=java.awt.BorderLayout,title=My frame,resizable,normal]
No IllegalComponentStateException
device = Win32GraphicsDevice[screen=1]
device.getFullScreenWindow() = null
------------------------------
- duplicates
-
JDK-6838089 java.awt.Window.setOpacity() doesn't throw IllegalComponentStateException for two-display conf
- Closed
- relates to
-
JDK-6838942 java.awt.Window.setShape() doesn't throw IllegalComponentStateException for two-display conf
- Closed