repaint()的疑问!
来源:百度知道 编辑:UC知道 时间:2024/09/21 06:03:58
repaint()调用repaint(0,0,0,width,height)
repaint(0,0,0,width,height)的源代码是:
public void repaint(long tm, int x, int y, int width, int height) {
if (this.peer instanceof LightweightPeer) {
// Needs to be translated to parent coordinates since
// a parent native container provides the actual repaint
// services. Additionally, the request is restricted to
// the bounds of the component.
if (parent != null) {
int px = this.x + ((x < 0) ? 0 : x);
int py = this.y + ((y < 0) ? 0 : y);
int pwidth = (width > this.width) ? this.width : width;
int pheight = (height > this.height) ? this.height : height;
parent.repaint(tm, px, py, pwidth, pheight);
}
} else {
if (isVisible() && (this.peer != null) &&