public synchronized void paintDirtyRegions()
public void paintDirtyRegions()
  public synchronized void paintDirtyRegions()      {    // In order to keep the blocking of application threads minimal, we switch    // the dirtyComponents field with the workdirtyComponents field and the    // repaintOrder field with the workRepaintOrder field and work with the    // work* fields.    synchronized(this)    {      ArrayList swap = workRepaintOrder;      workRepaintOrder = repaintOrder;      repaintOrder = swap;      HashMap swap2 = workDirtyComponents;      workDirtyComponents = dirtyComponents;      dirtyComponents = swap2;    }    for (Iterator i = workRepaintOrder.iterator(); i.hasNext();)      {        JComponent comp = (JComponent) i.next();        // If a component is marked completely clean in the meantime, then skip        // it.        Rectangle damaged = (Rectangle) workDirtyComponents.get(comp);        if (damaged == null || damaged.isEmpty())          continue;        comp.paintImmediately(damaged);      }    workRepaintOrder.clear();    workDirtyComponents.clear();  }