菜鸟问题----送分

cmcfeng 2003-02-21 03:53:30
请问validate()和repaint()两者有什么区别?请详细讲解
多谢!!!
...全文
23 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
htl 2003-02-23
  • 打赏
  • 举报
回复
validate()是针对容器中的组件重新布局的,而repaint()是更新图案等界面外观
hoxisoft 2003-02-21
  • 打赏
  • 举报
回复
validate()将容器中的所有组件重新布局。一般多和update(),repaint()一类方法配合使用,多用来动态更新界面外观,
repaint()则调用update().
cmcfeng 2003-02-21
  • 打赏
  • 举报
回复
请楼上的给出中文解释
我英文实在太菜
iamqqmyheart 2003-02-21
  • 打赏
  • 举报
回复
invalidate:
Invalidates this component. This component and all parents above it are marked as needing to be laid out. This method can be called often, so it needs to execute quickly


repaint:
Repaints the specified rectangle of this component.
This method causes a call to this component's update method as soon as possible.

62,615

社区成员

发帖
与我相关
我的任务
社区描述
Java 2 Standard Edition
社区管理员
  • Java SE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧