diff -r 5060b1928712 -r f6d501f12376 jdk/src/windows/classes/sun/awt/Win32GraphicsEnvironment.java --- a/jdk/src/windows/classes/sun/awt/Win32GraphicsEnvironment.java Fri Sep 27 22:17:24 2013 +0400 +++ b/jdk/src/windows/classes/sun/awt/Win32GraphicsEnvironment.java Fri Sep 27 22:25:58 2013 +0400 @@ -93,7 +93,12 @@ protected native int getDefaultScreen(); public GraphicsDevice getDefaultScreenDevice() { - return getScreenDevices()[getDefaultScreen()]; + GraphicsDevice[] screens = getScreenDevices(); + if (screens.length == 0) { + throw new AWTError("no screen devices"); + } + int index = getDefaultScreen(); + return screens[0 < index && index < screens.length ? index : 0]; } /**