title: java.awt.GraphicsEnvironment.getMaximumWindowBounds() does not change after screen mode changes
body: <p>I've noticed that if the screen mode is changed outside of Java that <code>java.awt.GraphicsEnvironment.getMaximumWindowBounds()</code> still returns the size before the screen size changed.<br>
  But <code>java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDisplayMode()</code> works and shows the new resolution.</p>
  
  <p>I've traced <code>getMaximumBounds()</code> to a call to <code>GraphicsDevice.getDefaultConfiguration()</code> that I suspect is using a stale configuration.</p>
  
  <p>My question is: is there some way to tell Java the screen configuration has changed or is this just a bug?</p>
  
  <p>Thanks.</p>
  
  <p>Here is a simple app that shows the bug:</p>
  
  <pre><code>import java.awt.*;
  
  public class test {
    public static void print() {
      try {
        Rectangle r = java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment().getMaximumWindowBounds();
        System.out.println("max window bounds=" + r);
        DisplayMode mode = java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDisplayMode();
        System.out.println("mode=" + mode.getWidth() + "x" + mode.getHeight());
        GraphicsConfiguration gc = java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDefaultConfiguration();
        Insets insets = Toolkit.getDefaultToolkit().getScreenInsets(gc);
        System.out.println("insets=" + insets);
      } catch (Exception e) {}
    }
    public static void main(String args[]) {
      try {
        print();
        System.out.println("Change video mode and press Enter to continue...");
        System.in.read();
        print();
      } catch (Exception e) {}
    }
  }
  </code></pre>