jdk/src/solaris/classes/sun/awt/X11GraphicsEnvironment.java
changeset 20433 f6d501f12376
parent 18178 ee71c923891d
child 20434 19c5cdb0d7a2
equal deleted inserted replaced
20432:5060b1928712 20433:f6d501f12376
   198     protected native int getDefaultScreenNum();
   198     protected native int getDefaultScreenNum();
   199     /**
   199     /**
   200      * Returns the default screen graphics device.
   200      * Returns the default screen graphics device.
   201      */
   201      */
   202     public GraphicsDevice getDefaultScreenDevice() {
   202     public GraphicsDevice getDefaultScreenDevice() {
   203         return getScreenDevices()[getDefaultScreenNum()];
   203         GraphicsDevice[] screens = getScreenDevices();
       
   204         if (screens.length == 0) {
       
   205             throw new AWTError("no screen devices");
       
   206         }
       
   207         int index = getDefaultScreenNum();
       
   208         return screens[0 < index && index < screens.length ? index : 0];
   204     }
   209     }
   205 
   210 
   206     public boolean isDisplayLocal() {
   211     public boolean isDisplayLocal() {
   207         if (isDisplayLocal == null) {
   212         if (isDisplayLocal == null) {
   208             SunToolkit.awtLock();
   213             SunToolkit.awtLock();