jdk/src/share/classes/sun/java2d/SunGraphicsEnvironment.java

Print this page

        

*** 23,32 **** --- 23,33 ---- * questions. */ package sun.java2d; + import java.awt.AWTError; import java.awt.Color; import java.awt.Font; import java.awt.Graphics2D; import java.awt.GraphicsConfiguration; import java.awt.GraphicsDevice;
*** 132,141 **** --- 133,145 ---- */ public synchronized GraphicsDevice[] getScreenDevices() { GraphicsDevice[] ret = screens; if (ret == null) { int num = getNumScreens(); + if (num == 0) { + throw new AWTError("no screen devices"); + } ret = new GraphicsDevice[num]; for (int i = 0; i < num; i++) { ret[i] = makeScreenDevice(i); } screens = ret;