src/share/classes/javax/swing/JComponent.java
Print this page
*** 61,70 ****
--- 61,71 ----
import javax.swing.event.*;
import javax.swing.plaf.*;
import static javax.swing.ClientPropertyKey.*;
import javax.accessibility.*;
+ import sun.awt.SunToolkit;
import sun.swing.SwingUtilities2;
import sun.swing.UIClientPropertyKey;
/**
* The base class for all Swing components except top-level containers.
*** 4799,4809 ****
* @see #isPaintingOrigin()
* @see java.awt.Component#isShowing
* @see RepaintManager#addDirtyRegion
*/
public void repaint(long tm, int x, int y, int width, int height) {
! RepaintManager.currentManager(this).addDirtyRegion(this, x, y, width, height);
}
/**
* Adds the specified region to the dirty region list if the component
--- 4800,4811 ----
* @see #isPaintingOrigin()
* @see java.awt.Component#isShowing
* @see RepaintManager#addDirtyRegion
*/
public void repaint(long tm, int x, int y, int width, int height) {
! RepaintManager.currentManager(SunToolkit.targetToAppContext(this))
! .addDirtyRegion(this, x, y, width, height);
}
/**
* Adds the specified region to the dirty region list if the component
*** 4854,4864 ****
// new Component). Also, if we do add a check to isValid
// here it can potentially be called before the constructor
// which was causing some people grief.
return;
}
! if (SwingUtilities.isEventDispatchThread()) {
invalidate();
RepaintManager.currentManager(this).addInvalidComponent(this);
}
else {
// To avoid a flood of Runnables when constructing GUIs off
--- 4856,4866 ----
// new Component). Also, if we do add a check to isValid
// here it can potentially be called before the constructor
// which was causing some people grief.
return;
}
! if (SunToolkit.isDispatchThreadForAppContext(this)) {
invalidate();
RepaintManager.currentManager(this).addInvalidComponent(this);
}
else {
// To avoid a flood of Runnables when constructing GUIs off
*** 4876,4886 ****
setFlag(REVALIDATE_RUNNABLE_SCHEDULED, false);
}
revalidate();
}
};
! SwingUtilities.invokeLater(callRevalidate);
}
}
/**
* If this method returns true, <code>revalidate</code> calls by
--- 4878,4888 ----
setFlag(REVALIDATE_RUNNABLE_SCHEDULED, false);
}
revalidate();
}
};
! SunToolkit.executeOnEventHandlerThread(this, callRevalidate);
}
}
/**
* If this method returns true, <code>revalidate</code> calls by