The following code:
public class Temp {
public static void main(String[] args) {
GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
GraphicsDevice[] devices = ge.getScreenDevices();
for (GraphicsDevice device : devices) {
Frame w = new Frame();
//w.setBackground(Color.BLACK);
device.setFullScreenWindow(w);
}
}
}
throws NPE on JDK7 b57 like the following:
Exception in thread "main" java.lang.NullPointerException
at java.awt.GraphicsDevice.setFullScreenWindow(GraphicsDevice.java:285)
at sun.awt.Win32GraphicsDevice.setFullScreenWindow(Win32GraphicsDevice.java:365)
at shapedtrans.Temp.main(Temp.java:12)
...
Code sample works for JDK6