public synchronized void addInvalidComponent(JComponent invalidComponent){
  RepaintManager delegate=getDelegate(invalidComponent);
  if (delegate != null) {
    delegate.addInvalidComponent(invalidComponent);
    return;
  }
  Component validateRoot=SwingUtilities.getValidateRoot(invalidComponent,true);
  if (validateRoot == null) {
    return;
  }
  if (invalidComponents == null) {
    invalidComponents=new ArrayList<Component>();
  }
 else {
    int n=invalidComponents.size();
    for (int i=0; i < n; i++) {
      if (validateRoot == invalidComponents.get(i)) {
        return;
      }
    }
  }
  invalidComponents.add(validateRoot);
  scheduleProcessingRunnable(SunToolkit.targetToAppContext(invalidComponent));
}

public synchronized void addInvalidComponent ( JComponent invalidComponent ) { RepaintManager delegate = getDelegate ( invalidComponent ) ; if ( delegate != null ) { delegate . addInvalidComponent ( invalidComponent ) ; return ; } Component validateRoot = SwingUtilities . getValidateRoot ( invalidComponent , true ) ; if ( validateRoot == null ) { return ; } if ( invalidComponents == null ) { invalidComponents = new ArrayList < Component > ( ) ; } else { int n = invalidComponents . size ( ) ; for ( int i = 0 ; i < n ; i ++ ) { if ( validateRoot == invalidComponents . get ( i ) ) { return ; } } } invalidComponents . add ( validateRoot ) ; scheduleProcessingRunnable ( SunToolkit . targetToAppContext ( invalidComponent ) ) ; }
mark the component as in need of layout and queue a runnable for the event dispatching thread that will validate the components first isvalidateroot ( ) ancestor .
