jdk/src/windows/classes/sun/awt/Win32GraphicsEnvironment.java
Print this page
*** 91,101 ****
protected native int getNumScreens();
protected native int getDefaultScreen();
public GraphicsDevice getDefaultScreenDevice() {
! return getScreenDevices()[getDefaultScreen()];
}
/**
* Returns the number of pixels per logical inch along the screen width.
* In a system with multiple display monitors, this value is the same for
--- 91,106 ----
protected native int getNumScreens();
protected native int getDefaultScreen();
public GraphicsDevice getDefaultScreenDevice() {
! 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];
}
/**
* Returns the number of pixels per logical inch along the screen width.
* In a system with multiple display monitors, this value is the same for