src/share/classes/java/awt/Window.java

Print this page

        

@@ -766,11 +766,11 @@
 
         if(beforeFirstShow) {
             isPacked = true;
         }
 
-        validate();
+        validateUnconditionally();
     }
 
     /**
      * Sets the minimum size of this window to a constant
      * value.  Subsequent calls to {@code getMinimumSize}

@@ -942,11 +942,11 @@
     @Deprecated
     public void show() {
         if (peer == null) {
             addNotify();
         }
-        validate();
+        validateUnconditionally();
 
         isInShow = true;
         if (visible) {
             toFront();
         } else {

@@ -2599,10 +2599,25 @@
                                           PropertyChangeListener listener) {
         super.addPropertyChangeListener(propertyName, listener);
     }
 
     /**
+     * Indicates if this container is a validate root.
+     * <p>
+     * {@code Window} objects are the validate roots, and therefore override
+     * this method to return {@code true}.
+     *
+     * @return {@code true}
+     * @since 1.7
+     * @see java.awt.Container#isValidateRoot
+     */
+    @Override
+    public boolean isValidateRoot() {
+        return true;
+    }
+
+    /**
      * Dispatches an event to this window or one of its sub components.
      * @param e the event
      */
     void dispatchEventImpl(AWTEvent e) {
         if (e.getID() == ComponentEvent.COMPONENT_RESIZED) {