src/share/classes/java/awt/Toolkit.java

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 1995, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.  Oracle designates this

@@ -465,11 +465,11 @@
     protected void loadSystemColors(int[] systemColors)
         throws HeadlessException {
         GraphicsEnvironment.checkHeadless();
     }
 
-/**
+    /**
      * Controls whether the layout of Containers is validated dynamically
      * during resizing, or statically, after resizing is complete.
      * Use {@code isDynamicLayoutActive()} to detect if this feature enabled
      * in this program and is supported by this operating system
      * and/or window manager.

@@ -495,13 +495,16 @@
      * @see       #isDynamicLayoutActive()
      * @see       #getDesktopProperty(String propertyName)
      * @see       java.awt.GraphicsEnvironment#isHeadless
      * @since     1.4
      */
-    public void setDynamicLayout(boolean dynamic)
+    public void setDynamicLayout(final boolean dynamic)
         throws HeadlessException {
         GraphicsEnvironment.checkHeadless();
+        if (this != getDefaultToolkit()) {
+            getDefaultToolkit().setDynamicLayout(dynamic);
+        }
     }
 
     /**
      * Returns whether the layout of Containers is validated dynamically
      * during resizing, or statically, after resizing is complete.