当前位置: 技术问答>java相关
求Applet中paint,repaint,update的联系和区别。
来源: 互联网 发布时间:2015-05-13
本文导语: 谢谢! | public void repaint() Repaints this component. This method causes a call to this component's update method as soon as possible. public void update(Graphics g) The AWT calls the update method in response to a...
谢谢!
|
public void repaint()
Repaints this component.
This method causes a call to this component's update method as soon as possible.
public void update(Graphics g)
The AWT calls the update method in response to a call to repaintupdate or paint(not paint method).
The updatemethod of Component does the following:
Clears this component by filling it with the background color.
Sets the color of the graphics context to be the foreground color of this component.
Calls this component's paint method to completely redraw this component.
public void paint(Graphics g)
Paints this component.
repaint->update->paint
Repaints this component.
This method causes a call to this component's update method as soon as possible.
public void update(Graphics g)
The AWT calls the update method in response to a call to repaintupdate or paint(not paint method).
The updatemethod of Component does the following:
Clears this component by filling it with the background color.
Sets the color of the graphics context to be the foreground color of this component.
Calls this component's paint method to completely redraw this component.
public void paint(Graphics g)
Paints this component.
repaint->update->paint
您可能感兴趣的文章:
本站(WWW.)旨在分享和传播互联网科技相关的资讯和技术,将尽最大努力为读者提供更好的信息聚合和浏览方式。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。