求Applet中paint,repaint,update的联系和区别。

CFree 2002-04-22 11:59:37
谢谢!
...全文
129 1 打赏 收藏 举报
写回复
1 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
nothing 2002-04-22
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
  • 打赏
  • 举报
回复
发帖
Java SE

6.2w+

社区成员

Java 2 Standard Edition
社区管理员
  • Java SE
加入社区
帖子事件
创建了帖子
2002-04-22 11:59
社区公告
暂无公告