jdk/src/share/classes/sun/java2d/SunGraphicsEnvironment.java
Print this page
*** 163,173 ****
/**
* Returns the default screen graphics device.
*/
public GraphicsDevice getDefaultScreenDevice() {
! return getScreenDevices()[0];
}
/**
* Returns a Graphics2D object for rendering into the
* given BufferedImage.
--- 163,177 ----
/**
* Returns the default screen graphics device.
*/
public GraphicsDevice getDefaultScreenDevice() {
! GraphicsDevice[] screens = getScreenDevices();
! if (screens.length == 0) {
! throw new AWTError("no screen devices");
! }
! return screens[0];
}
/**
* Returns a Graphics2D object for rendering into the
* given BufferedImage.