title: Get desktop bounds without GraphicsDevice.getConfigurations()
body: <p>I am new to Java and trying to determine how GraphicsDevice.getDefaultConfiguration() differs from what GraphicsDevice.getConfigurations() returns.</p>
  
  <p>Some users are getting a serious slowdown when they start out application. I have found one machine that reproduces the issue which I am thinking is cause by this <a href="https://bugs.openjdk.java.net/browse/JDK-6477756" rel="nofollow">https://bugs.openjdk.java.net/browse/JDK-6477756</a></p>
  
  <p>This led me to see if I can avoid using GraphicsDevice.getConfigurations(). I just need to know the bounds of the desktop and I see two ways to do it.  They seem to do the same thing in all my testing but I hope someone knowledgeable can tell me if there will be different behavior in some situations.</p>
  
  <p>Method 1</p>
  
  <pre><code>Rectangle result = new Rectangle();
  for (GraphicsDevice graphicsDevice : graphicsEnv.getScreenDevices()) {
     for (GraphicsConfiguration graphicsConfiguration :  graphicsDevice.getConfigurations()) {
        Rectangle2D.union(result, graphicsConfiguration.getBounds(), result);
     }
  }
  </code></pre>
  
  <p>Method 2</p>
  
  <pre><code>GraphicsEnvironment graphicsEnv =   GraphicsEnvironment.getLocalGraphicsEnvironment();
  Rectangle result = new Rectangle();
  for (GraphicsDevice graphicsDevice : graphicsEnv.getScreenDevices()) {
          Rectangle2D.union(result,  graphicsDevice.getDefaultConfiguration().getBounds(), result);
  }
  </code></pre>
  
  <p>Method 2 is much faster on the machine that reproduces the users slowdown.  Is there any reason not to use it instead?</p>