src/share/classes/java/awt/Container.java

Print this page

        

@@ -1480,16 +1480,25 @@
      * @see #layout
      * @see LayoutManager
      * @see LayoutManager2#invalidateLayout(Container)
      */
     public void invalidate() {
+        // Note: the actions with the LayoutManager2 happen at invalidateImpl()
+        super.invalidate();
+    }
+
+    @Override
+    void invalidateImpl() {
+        checkTreeLock();
+
         LayoutManager layoutMgr = this.layoutMgr;
         if (layoutMgr instanceof LayoutManager2) {
             LayoutManager2 lm = (LayoutManager2) layoutMgr;
             lm.invalidateLayout(this);
         }
-        super.invalidate();
+
+        super.invalidateImpl();
     }
 
     /**
      * Validates this container and all of its subcomponents.
      * <p>